java - How to use log4j2 file appender feature in unix environment -
java - How to use log4j2 file appender feature in unix environment -
i new unix. have below log4j2 config file. when utilize file in unix environment, file app.log not created. 1 tell me how redirect logs file in unix environment
<?xml version="1.0" encoding="utf-8"?> <configuration status="warn"> <appenders> <console name="console" target="system_out"> <patternlayout pattern="%d{hh:mm:ss.sss} [%t] %-5level %logger{36} %method - %msg%n" /> </console> <file name="file" filename="c:\users\ppatrana\desktop\app.log"> <!-- <pattern>%d %p %c{1.} [%t] %m %ex%n</pattern> --> <patternlayout pattern="%d{hh:mm:ss.sss} [%t] %-5level %logger{36} %method - %msg%n" /> </file> </appenders> <loggers> <root level="trace"> <appenderref ref="console" /> </root> <root level="trace"> <appenderref ref="file" /> </root> </loggers> </configuration>
you have alter filename :
<file name="file" filename="/tmp/app.log">
more linux filesystem : http://en.wikipedia.org/wiki/filesystem_hierarchy_standard
java logging log4j2
Comments
Post a Comment