Jose Luis Valencia | 7 Jul 17:18 2015

Exception using log4j-web and spring WebApplicationInitializer

I want to use log4j-web in a app that uses spring WebApplicationInitializer
but when I include log4j-web dependency the application gives this

java.lang.IllegalStateException: Cannot initialize context because there is
already a root application context present - check whether you have
multiple ContextLoader* definitions in your web.xml!

 and my WebApplicationInitializer is called twice even when I set
context param to "true" programmatically and in web.xml.

​José Valencia​
Sandeep Dasika | 7 Jul 09:01 2015

Query regarding SocketAppender and SimpleSocketServer

Hi log4j team,

I have been using log4j in production systems, and it has delivered us
fantastically. My query is around the SocketAppender and SimpleSocketServer
functionality. We have a group of servers that generate log events. These
are configured to write to file appenders. We also want to have error logs
written to a central log file so that it can be easy to browse to find
potential issues in our product.

I have the natural setup for the remote logging up and running perfectly -
The clients that generate the LoggingEvent objects (our production servers)
all write to a SocketAppender that will send it across to the remote
SimpleSocketServer and that ultimately writes to another file appender,
which gives us the centralised log file to browse. However, since we want
to run it at ERROR level, it would be best for us if we have some client ID
(maybe IP) of the client that sends a particular logging event at the
remote end so that it would be easier for us to pinpoint the problems in
our systems. Seems like I'm not sure how that can be done in log4j. Any
hints/suggestions on this would really help me out!

Thanks in advance.
Gary Gregory | 6 Jul 17:21 2015

Re: Parameter isLog4jAutoInitializationDisabled ignored when used alongside log4jConfiguration?

Did you get you configuration to work?


On Fri, Jun 26, 2015 at 1:57 AM, Gary Gregory <garydgregory <at>>

> OK, so we can rule out the obvious Tomcat 7.0.43 issue mentioned on
> Gary
> On Fri, Jun 26, 2015 at 1:17 AM, Robin Jansohn <snoopi30 <at>> wrote:
>> Starting Servlet Engine: Apache Tomcat/7.0.47
>> --
>> View this message in context:
>> Sent from the Log4j - Users mailing list archive at
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe <at>
>> For additional commands, e-mail: log4j-user-help <at>
(Continue reading)

David KOCH | 6 Jul 13:14 2015

Get properties from configuration programatically.


Is there a way to get the properties from a log4j2 configuration file


<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG" monitorInterval="10">

    <Property name="kafkaHost">localhost:9092</Property>


I tried:

LoggerContext ctx = (LoggerContext) LogManager.getContext(false);

However, this only returns global properties like hostName and not the
custom ones I added to the configuration.

Thank you,

Simon | 3 Jul 19:22 2015

Re: RollingFileAppeneder MaxSize + keep 30 days

If you're stuck on Log4J 1.2 then you could try out the TimeAndSizeRollingAppender available at

Sent from TypeMail

On 2 Jul 2015 23:54, at 23:54, Benjamin Jaton <benjamin.jaton <at>> wrote:
>How can I define a RollingFileAppender that would roll when it reaches
>100MB, and that would discard any log older than 30 days (not before)?
>I need to keep 30 days of logs for auditing purposes, but I also want
>limit the logs to a certain size as well.
Jose Luis Valencia | 3 Jul 16:38 2015

Log4j - Jul Bridge in a web application

​I am working with Java components that use JUL in a web application and I
am not able to get JUL logs routed to log4j 2, I added the required maven
dependency for log4j-jul and set
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager ​in the
command line but maven gives an NoSuchClassexception because
org.apache.logging.log4j.jul.LogManager is not yet loaded and by
System.setProperty() in a spring CustomWebApplicationInitializer but says it
must be called before any call of to LogManager or Logger. ¿Where I should
set the system property in a web application?

Thank you!

Benjamin Jaton | 3 Jul 00:53 2015

RollingFileAppeneder MaxSize + keep 30 days


How can I define a RollingFileAppender that would roll when it reaches
100MB, and that would discard any log older than 30 days (not before)?

I need to keep 30 days of logs for auditing purposes, but I also want to
limit the logs to a certain size as well.

dyf6372 | 1 Jul 10:43 2015

Question about using log4j

We use log4j to print the log about our system. Sometimes the computer will be crashed and reboot. Before the
computer down, the log4j will print many " <at> ". I want to know what the meaning of “ <at> “ is and when it will
appear. Thank you very much!

My Best Wishes!
dyf6372 <at> dyf6372 <at>
Saurabh Jain | 30 Jun 10:49 2015

Mapped diagnostic context

Hello list

I was implementing MDC as per requirement have to pass additional
parameters to the logger.

Can someone help me suggesting best way to implement MDC or any other way
of achieving the requirement.

Ralph Goers | 29 Jun 18:33 2015

Re: Hide *.jar

OK, so you only want to hide hibernate from the stack trace.  Then modify your pattern for the PatternLayout
to include %xEx{full,filters[org.hibernate]}


> On Jun 29, 2015, at 9:19 AM, Emi Lu <emilu <at>> wrote:
> Mailing list bounced my email. 
> -------- Forwarded Message --------
> Subject:	Re: Hide *.jar
> Date:	Mon, 29 Jun 2015 12:16:34 -0400
> From:	Emi Lu <emilu <at>> <mailto:emilu <at>>
> Reply-To:	emilu <at> <mailto:emilu <at>>
> To:	log4j-user <at> <mailto:log4j-user <at>>
> On 06/29/2015 12:04 PM, Ralph Goers wrote:
>> Can you post the full output of the log event?
> Here it is. 
> Red lines are the ones I want to hide. 
> 2015-Jun-29 12:10:39.214 [http-8080-5] ERROR DBUtilUser - set gui_model Error: could not extract
ResultSet  SELECT   ****** ORDER BY   1, 2, 3 
> 2015-Jun-29 12:10:39.215 [http-8080-5] ERROR DBUtilUser -
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
> 2015-Jun-29 12:10:39.217 [http-8080-5] ERROR
org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during
processing request: could not extract ResultSet
(Continue reading)

Emi Lu | 29 Jun 16:45 2015

Hide *.jar

Hello List,

May I know how to hide the following *.jar info please?




     at org.hibernate.loader.Loader.getResultSet( 
(Continue reading)