log4j2 specify relative path to tomcat home dir for FileAppender

I solved my own issue. For system properties you need to prefix variables with sys:. <FastFile name=”ALog” fileName=”${sys:catalina.home}/logs/test.log” immediateFlush=”true” append=”true”> <PatternLayout> <pattern>%d %p %c{1.} [%t] %m%n</pattern> </PatternLayout> </FastFile> Found it after re-reading this part of the documentation: http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution

Very simple log4j2 XML configuration file using Console and File appender

<?xml version=”1.0″ encoding=”UTF-8″?> <Configuration status=”INFO”> <Appenders> <Console name=”Console” target=”SYSTEM_OUT”> <PatternLayout pattern=”%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n” /> </Console> <File name=”MyFile” fileName=”all.log” immediateFlush=”false” append=”false”> <PatternLayout pattern=”%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} – %msg%n”/> </File> </Appenders> <Loggers> <Root level=”debug”> <AppenderRef ref=”Console” /> <AppenderRef ref=”MyFile”/> </Root> </Loggers> </Configuration> Notes: Put the following content in your configuration file. Name the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)