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