java - log4j configuration for external jars -
i have 2 maven projects , b. using b.jar external jar. log4j.properties below
log4j.rootlogger=info,file log4j.appender.file=org.apache.log4j.rollingfileappender log4j.appender.file.file=/u01/app/log/a.log log4j.appender.file.maxfilesize=10mb log4j.appender.file.maxbackupindex=10 log4j.appender.file.layout=org.apache.log4j.patternlayout log4j.appender.file.layout.conversionpattern=%d{yyyy-mm-dd hh:mm:ss} %-5p %c{1}:%l - %m%n
/u01/app/log directory directory in server java application deployed. writing logs specified file not writing logs b.jar in file ,when tried same properties in b.jar.it seems b not able access directory..please me configure properties in b.jar , write logs b same file a.log
if maven projects, maven forces structure projects.
you should put configuration files in resources
project |-- pom.xml `-- src `-- main `-- resources
maven find them. in case, should have 2 configuration file project , b , configuration file project , configuration file project b should ready in appropriate places (resources in case)
Comments
Post a Comment