java - How to log with same log4j.properties files for two different Spring-Boot Applications? -


suppose have 2 spring-boot applications called config , eureka.

config made of:

config    /src/main     /java       /com.example         demo.java     /resources       application.properties 

eureka made of:

eureka    /src/main     /java       /com.example         demo.java     /resources       application.properties 

i have log4j.properties files

log4j.rootlogger=info, stdout, file  log4j.appender.stdout=org.apache.log4j.consoleappender log4j.appender.stdout.target=system.out log4j.appender.stdout.layout=org.apache.log4j.patternlayout log4j.appender.stdout.layout.conversionpattern=[%d{yyyy:mm:dd hh:mm:ss.sss}] - %p [%t] --- %c : %m%n  log4j.appender.file=org.apache.log4j.fileappender log4j.appender.file.file=log.out log4j.appender.file.layout=org.apache.log4j.patternlayout log4j.appender.file.layout.conversionpattern=[%d{yyyy:mm:dd hh:mm:ss.sss}]  - %p [%t] --- %c : %m%n 

one way log both config , eureka keeping copy of properties file in resources folder of both applications , giving common path log file in both. have tried , works correctly.

i want different. want maintain single log4j.properties file instead of 2 both applications. question proper way this? how?

you can keep log4j.properties in common location (in windows c:\boots), refer in application.properties.

logging.config = c:\boots\log4j.properties 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -