I'm not sure I understand...

are you suggesting that rather then configuring our logger like this:
 static Logger log = LoggerFactory.getLogger(SolrCore.class);

We get the Logger everytime we use it with something like:
 Logger log = LoggerFactory.getLogger(classname+":"+core.getName() );

That seems like a lot of overhead for marginal gain...

------

Another option I can think of (shooting from the hip here) is to add the core object to each log message. For example, rather then:
  log.info( logid+"Searching for listeners: " +path );
we call:
 log.info( logid+"Searching for listeners: " +path, core );

this way, one *could* implement the SLF4J api to look for cores as parameters and delegate the logger appropriately.

other ideas?


On Dec 17, 2008, at 10:42 AM, Erik Hatcher wrote:

Can't we log with the core as part of the context of the logger, rather than just the classname? This would give you core logging granularity just by config, rather than scraping.

Yes?

        Erik

On Dec 17, 2008, at 9:47 AM, Ryan McKinley wrote:

As is, the log classes are statically bound to the class, so they are configured for the entire VM context.

Off hand i can't think of any good work around either. The only thing to note is that most core specific log messages include the core name as a prefix: [core0] ...

ryan


On Dec 17, 2008, at 6:07 AM, Marc Sturlese wrote:


Hey there,

My original app (before getting into Solr) use to have 3 index in the same
web app. I used log4j with a log file per index.

Now in Solr I have different cores and I am trying to set a log file per
core via slf4 but don't know how to do it.
As I understood this thread:
http://www.nabble.com/Details-on-logging-in-Solr-td21027267.html#a21027540
You can just instantiate a log file per sol web_app and not per core?

Thanks in advance
--
View this message in context: 
http://www.nabble.com/setting-a-log-file-per-core-with-slf4-tp21051199p21051199.html
Sent from the Solr - User mailing list archive at Nabble.com.



Reply via email to