[I
responded to this a minute ago, accidentally prematurely hit "send",
sorry for the spam in my
signature on that one
]
If you are using Log4j, you can easily change the root logger level with:
org.apache.log4j.Logger.getRootLogger().setLevel(Level.DEBUG);
The Level class has constants for log levels or static methods to get log
levels via strings. It
is pretty easy to configure log4j at runtime w/ finer grained control, see the
javadoc.
I tend to typically wire things up with a standard config file in a default way
that I want the
app to run (probably ERROR level) and then adjust things at runtime as needed.
Hope this helps!
Rob
--- Albin Joseph <helloalbin
gmail.com>
wrote:
> hi experts
>
> I want to configure Log4J or J2SE 1.4 logging programmatically. I
> don't want to use any configuration files for configuring Log4J /J2SE
> 1.4 logging . I want to enable/disable logging facility at runtime
> from my program. Sometime I may require to turn on only DEBUG,
> sometimes DEBUG and INFO may be required. How can I do that? Please
> help me. Any help would be much valuable.
>
> Thanks
> Albin Joseph
> http://www.javacertificate.net
>
>
>
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com