logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: [2/4] git commit: Doc update regarding how servlet contexts can be named.
Date Sun, 21 Sep 2014 23:37:22 GMT
In other places the log4j policy is that logging config errors or errors during logging should
not impact the application unless the user asked for it (as in audit logging). 

So, logging the error would be consistent with that. On the other hand we haven't had any
complaints...

If this fails though, would calls to logger methods be silently ignored or what would happen?

(Is it even possible to log the problem and keep on truckin'? )

Sent from my iPhone

> On 2014/09/22, at 8:28, Matt Sicker <boards@gmail.com> wrote:
> 
> Well, the way the code currently is written, it looks like it does indeed throw an exception
which would propagate upward to the ServletContextListener or ServletContainerListener, so
it's still correct. Perhaps it shouldn't actually do that and just log an error?
> 
>> On 21 September 2014 18:22, Remko Popma <remko.popma@gmail.com> wrote:
>> The docs say
>> > otherwise, the application will fail to start with an exception.
>> 
>> Is this true? Or should that be ...logging will fail to start with an exception.
>> 
>> Sent from my iPhone
>> 
>> > On 2014/09/22, at 8:09, mattsicker@apache.org wrote:
>> >
>> > Doc update regarding how servlet contexts can be named.
>> >
>> >
>> > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
>> > Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3c868456
>> > Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3c868456
>> > Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3c868456
>> >
>> > Branch: refs/heads/master
>> > Commit: 3c868456ed043673a889cdcd0afe3513a695dd72
>> > Parents: 0e5cc42
>> > Author: Matt Sicker <mattsicker@apache.org>
>> > Authored: Sun Sep 21 17:21:07 2014 -0500
>> > Committer: Matt Sicker <mattsicker@apache.org>
>> > Committed: Sun Sep 21 17:21:07 2014 -0500
>> >
>> > ----------------------------------------------------------------------
>> > src/site/xdoc/manual/webapp.xml | 12 +++++++-----
>> > 1 file changed, 7 insertions(+), 5 deletions(-)
>> > ----------------------------------------------------------------------
>> >
>> >
>> > http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3c868456/src/site/xdoc/manual/webapp.xml
>> > ----------------------------------------------------------------------
>> > diff --git a/src/site/xdoc/manual/webapp.xml b/src/site/xdoc/manual/webapp.xml
>> > index ecad1f9..1b86d45 100644
>> > --- a/src/site/xdoc/manual/webapp.xml
>> > +++ b/src/site/xdoc/manual/webapp.xml
>> > @@ -177,17 +177,19 @@
>> >       <subsection name="Context Parameters">
>> >         <a name="ContextParams" />
>> >         <p>
>> > -          By default, Log4j 2 uses the <code>ServletContext</code>'s
context name as the <code>LoggerContext</code> name
>> > -          and uses the standard pattern for locating the Log4j configuration
file. There are three context parameters
>> > -          that you can use to control this behavior. The first, <code>isLog4jContextSelectorNamed</code>,
specifies
>> > -          whether the context should be selected using the
>> > +          By default, Log4j 2 uses the <code>ServletContext</code>'s
>> > +          <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/ServletContext.html#getServletContextName()">context
name</a>
>> > +          as the <code>LoggerContext</code> name and uses the standard
pattern for locating the Log4j configuration
>> > +          file. There are three context parameters that you can use to control
this behavior. The first,
>> > +          <code>isLog4jContextSelectorNamed</code>, specifies whether
the context should be selected using the
>> >           <a class="javadoc" href="../log4j-core/apidocs/org/apache/logging/log4j/core/selector/JndiContextSelector.html"
>> >> JndiContextSelector</a>. If <code>isLog4jContextSelectorNamed</code>
is not specified or is anything other
>> >           than <code>true</code>, it is assumed to be <code>false</code>.
>> >         </p>
>> >         <p>
>> >           If <code>isLog4jContextSelectorNamed</code> is <code>true</code>,
<code>log4jContextName</code> must be
>> > -          specified; otherwise, the application will fail to start with an
exception. <code>log4jConfiguration</code>
>> > +          specified or <code>display-name</code> must be specified
in <code>web.xml</code>; otherwise, the application
>> > +          will fail to start with an exception. <code>log4jConfiguration</code>
>> >           <em>should</em> also be specified in this case, and must
be a valid URI for the configuration file; however,
>> >           this parameter is not required.
>> >         </p>
>> >
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 
> 
> 
> -- 
> Matt Sicker <boards@gmail.com>

Mime
View raw message