[prev in list] [next in list] [prev in thread] [next in thread]
List: log4j-dev
Subject: Re: Logger setLevel?
From: Gary Gregory <garydgregory () gmail ! com>
Date: 2014-01-31 22:38:30
Message-ID: CACZkXPyhZWmmEU43wWjVdnnqSaG78iWHAZ0wM=5UuH=hn-7FWA () mail ! gmail ! com
[Download RAW message or body]
On Fri, Jan 31, 2014 at 1:13 PM, Scott Deboy <scott.deboy@gmail.com> wrote:
> Re: appenders, I was thinking about Remko's response here:
>
>
> http://stackoverflow.com/questions/21303746/migrating-from-log4j-1-2-to-log4j-2-how-to-get-list-of-all-appenders-and-rolli
>
I've done a bit more in this area to make it less painful.
Please see
https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderAccessTest.java
Gary
>
>
> On 1/31/14, Gary Gregory <garydgregory@gmail.com> wrote:
> > On Fri, Jan 31, 2014 at 1:05 PM, Scott Deboy <scott.deboy@gmail.com>
> wrote:
> >
> > > Add setlevel. I also think appender belongs in Api. Yes?
> > >
> >
> > Appenders are in the Core. That would be a big change.
> >
> > Another surprise: There is no Logger.getLevel().
> >
> > Gary
> >
> >
> > > On Jan 31, 2014 10:01 AM, "Gary Gregory" <garydgregory@gmail.com>
> wrote:
> > >
> > > > Porting from v1...
> > > >
> > > > We do not have Logger setLevel(Level) because it is not in the LCD API
> > > > (Slf4j no, Logback yes, JUL yes).
> > > >
> > > > This sure makes it a pain to port from v1.
> > > >
> > > > What are the choices?
> > > >
> > > > - I hard code everything to the Core Logger API, possible if
> inflexible.
> > > > - I add a util method that checks the Logger instance to see if it is a
> > > > Core Logger or if it is a Slf4j logger that wraps a logback logger?
> > > > Bleh.
> > > >
> > > > Or, we can add setLevel and have it propagate the call down. Then we
> can
> > > > discuss whether a missing API in the underlying system means a noop or
> > > > an
> > > > exception. Like JRE Collections do.
> > > >
> > > > Thoughts?
> > > >
> > > > Gary
> > > >
> > > > --
> > > > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > > > Java Persistence with Hibernate, Second
> > > > Edition<http://www.manning.com/bauer3/>
> > > > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > > > Spring Batch in Action <http://www.manning.com/templier/>
> > > > Blog: http://garygregory.wordpress.com
> > > > Home: http://garygregory.com/
> > > > Tweet! http://twitter.com/GaryGregory
> > > >
> > >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > Java Persistence with Hibernate, Second
> > Edition<http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
[Attachment #3 (text/html)]
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 31, 2014 \
at 1:13 PM, Scott Deboy <span dir="ltr"><<a href="mailto:scott.deboy@gmail.com" \
target="_blank">scott.deboy@gmail.com</a>></span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Re: appenders, I was thinking about Remko's \
response here:<br> <br>
<a href="http://stackoverflow.com/questions/21303746/migrating-from-log4j-1-2-to-log4j-2-how-to-get-list-of-all-appenders-and-rolli" \
target="_blank">http://stackoverflow.com/questions/21303746/migrating-from-log4j-1-2-to-log4j-2-how-to-get-list-of-all-appenders-and-rolli</a><br>
</blockquote><div><br></div><div>I've done a bit more in this area to make it \
less painful. <br><br>Please see <a \
href="https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/log4j-core/src/test/ \
java/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderAccessTest.java \
">https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/log4j-core/src/test/java \
/org/apache/logging/log4j/core/appender/rolling/RollingFileAppenderAccessTest.java</a><br>
<br></div><div>Gary<br> <br></div><blockquote class="gmail_quote" style="margin:0px \
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div><div \
class="h5"><br> <br>
On 1/31/14, Gary Gregory <<a \
href="mailto:garydgregory@gmail.com">garydgregory@gmail.com</a>> wrote:<br> > \
On Fri, Jan 31, 2014 at 1:05 PM, Scott Deboy <<a \
href="mailto:scott.deboy@gmail.com">scott.deboy@gmail.com</a>> wrote:<br> ><br>
>> Add setlevel. I also think appender belongs in Api. Yes?<br>
>><br>
><br>
> Appenders are in the Core. That would be a big change.<br>
><br>
> Another surprise: There is no Logger.getLevel().<br>
><br>
> Gary<br>
><br>
><br>
>> On Jan 31, 2014 10:01 AM, "Gary Gregory" <<a \
href="mailto:garydgregory@gmail.com">garydgregory@gmail.com</a>> wrote:<br> \
>><br> >>> Porting from v1...<br>
>>><br>
>>> We do not have Logger setLevel(Level) because it is not in the LCD \
API<br> >>> (Slf4j no, Logback yes, JUL yes).<br>
>>><br>
>>> This sure makes it a pain to port from v1.<br>
>>><br>
>>> What are the choices?<br>
>>><br>
>>> - I hard code everything to the Core Logger API, possible if \
inflexible.<br> >>> - I add a util method that checks the Logger instance to \
see if it is a<br> >>> Core Logger or if it is a Slf4j logger that wraps a \
logback logger?<br> >>> Bleh.<br>
>>><br>
>>> Or, we can add setLevel and have it propagate the call down. Then we \
can<br> >>> discuss whether a missing API in the underlying system means a \
noop or<br> >>> an<br>
>>> exception. Like JRE Collections do.<br>
>>><br>
>>> Thoughts?<br>
>>><br>
>>> Gary<br>
>>><br>
>>> --<br>
>>> E-Mail: <a \
href="mailto:garydgregory@gmail.com">garydgregory@gmail.com</a> | <a \
href="mailto:ggregory@apache.org">ggregory@apache.org</a><br> >>> Java \
Persistence with Hibernate, Second<br> </div></div>>>> Edition<<a \
href="http://www.manning.com/bauer3/" \
target="_blank">http://www.manning.com/bauer3/</a>><br> >>> JUnit in \
Action, Second Edition <<a href="http://www.manning.com/tahchiev/" \
target="_blank">http://www.manning.com/tahchiev/</a>><br> >>> Spring \
Batch in Action <<a href="http://www.manning.com/templier/" \
target="_blank">http://www.manning.com/templier/</a>><br> <div \
class="im">>>> Blog: <a href="http://garygregory.wordpress.com" \
target="_blank">http://garygregory.wordpress.com</a><br> >>> Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br> \
>>> Tweet! <a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a><br> >>><br>
>><br>
><br>
><br>
> --<br>
> E-Mail: <a href="mailto:garydgregory@gmail.com">garydgregory@gmail.com</a> | <a \
href="mailto:ggregory@apache.org">ggregory@apache.org</a><br> > Java Persistence \
with Hibernate, Second<br> </div>> Edition<<a \
href="http://www.manning.com/bauer3/" \
target="_blank">http://www.manning.com/bauer3/</a>><br> > JUnit in Action, \
Second Edition <<a href="http://www.manning.com/tahchiev/" \
target="_blank">http://www.manning.com/tahchiev/</a>><br> > Spring Batch in \
Action <<a href="http://www.manning.com/templier/" \
target="_blank">http://www.manning.com/templier/</a>><br> <div class="im">> \
Blog: <a href="http://garygregory.wordpress.com" \
target="_blank">http://garygregory.wordpress.com</a><br> > Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br> > \
Tweet! <a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a><br> ><br>
<br>
</div>---------------------------------------------------------------------<br>
To unsubscribe, e-mail: <a \
href="mailto:log4j-dev-unsubscribe@logging.apache.org">log4j-dev-unsubscribe@logging.apache.org</a><br>
For additional commands, e-mail: <a \
href="mailto:log4j-dev-help@logging.apache.org">log4j-dev-help@logging.apache.org</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">E-Mail: <a \
href="mailto:garydgregory@gmail.com" target="_blank">garydgregory@gmail.com</a> | <a \
href="mailto:ggregory@apache.org" target="_blank">ggregory@apache.org </a><br> <a \
href="http://www.manning.com/bauer3/" target="_blank">Java Persistence with \
Hibernate, Second Edition</a><br><a href="http://www.manning.com/tahchiev/" \
target="_blank">JUnit in Action, Second Edition</a><br><a \
href="http://www.manning.com/templier/" target="_blank">Spring Batch in \
Action</a><br>
Blog: <a href="http://garygregory.wordpress.com/" \
target="_blank">http://garygregory.wordpress.com</a> <br>Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br>Tweet! \
<a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a></div>
</div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic