help migrating to a custom LoggingFactory

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

help migrating to a custom LoggingFactory

Camuto, Matthew


I am migrating to my own extensions (inherited classes) for Loggers in
log4j but I also want to now add a new factory to my code such that:


Logger.getLogger(String name)


Will return a new custom type Logger (MYLogger for example) but I would
like this work without changing all the current source code at this


For example I would like


MYLogger ml = (MYLogger) Logger.getLogger(String name);


To be essentially the same as


MYLogger ml = (MYLogger) MYLogger.getLogger(String name); /// Custom


Upon reading the source code I thought I could do this by changing the
LoggingFactory in the file as following:





log4j.rootLogger=DEBUG, A1,INT,EXT






Where MyLoggerFactory is a custom logger factory I created. From looking
at the source code it seemed that I should now always create 'MYLogger'
instances from within even Logger.getLogger (String name) but this does
not seem to be the case.


Bascially I am trying to slow migrate to my own custom logger but would
like to NOT interfere with other developers if they do not need the new
functionality of my new logger just yet.


Any help would be great.