java - log4j / slf4j package-based logging, how to handle frameworks, e.g. spring? -


let's application consists of several components logged separately:

myapp.log myapp-foo.log myapp-bar.log 

my classes define "standard" java logger:

private static final logger logger = logmanager.getlogger(thisclass.class); 

logging components "foo" , "bar" set via package-based configuration (each of logs it's own logfile) :

<logger name="com.mycompany.myapp.foo" level="info">     <appenderref ref="foo"/> </logger>  <logger name="com.mycompany.myapp.bar" level="info">     <appenderref ref="bar"/> </logger> 

this works fine, point want see log messages framework use, such spring, since spring log statements end in myapp.log - not myapp-foo.log or myapp-bar.log.

it's convenient have 1 log4j.xml or log4j2.xml file, can use package-based log configuration in way - and still have spring log statements logged "correct" log file, myapp-foo.log of myapp-bar.log?

or there different solution?

edit: using spring 4.0.3.release , log4j2


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -