A comment from the sidelines:

- I haven't taken a close look at the new log format yet

- I think *appending* the core name might be better than inserting it at the 
beginning of the message, just in case people are analyzing logs and not 
counting on a new "field" suddenly showing up in their Solr logs 

- Mike's suggestion for appending the core name (the name var) to SolrCore 
class name for the Logger instance sounds good to me.  This would let people 
keep a separate log for each core (but I'm not sure if it would let them keep 
everything in the single log...would it?)

Otis

--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch

----- Original Message ----
From: Mike Klaas <[EMAIL PROTECTED]>
To: [email protected]
Sent: Friday, December 28, 2007 4:53:08 PM
Subject: Re: [jira] Resolved: (SOLR-441) example app comes up with some bad 
links

On 28-Dec-07, at 7:31 AM, Ryan McKinley wrote:

> Mike Klaas wrote:
>>
>> Looks great, thanks.  I haven't really followed the multicore  
>> discussion very closely (so ignore this if it doesn't compute),  
>> but might it make sense for the core-specific log object to  
>> automatically prepend the corename to the log message (cursorily,  
>> it looks like current it is necessary for each logging call to  
>> prepend the corename (.getLogId()) if the log message is to be  
>> core-specific)?
>
> Sounds like a good idea, but how would you do it?
>
> Right now it calls log.info( logId + "message..." ) everywhere.  Is  
> there a way to change the underlying log format for each core?   
> (log is currently a static Logger log = Logger.getLogger(...);

I'm not too familiar with jdk logging, but I think that it should be  
possible to assign each SolrCore its own Logger (using getLogger 
(<classname> +'.'+ <corename)), then modifying the config of the  
logger (this might be useful for other reasons too, such as making  
each core's logfile output to a different file).  The simplest  
configuration might be to assign a custom java.util.logging.Formatter  
which calls .setMessage() on the LogRecord to prepend the corename  
before passing to the SimpleFormatter superclass.

The world of java logging and associated configuration is a bit of a  
sordid beast, so I'm not sure if this is kosher with all the possible  
custom configurations and such.

-Mike



Reply via email to