You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ma...@etudiant.univ-lille1.fr on 2006/06/02 09:45:32 UTC

Weblogic - Concurrent access of the same appender by dif. applications

Hello,

I'm currently using Weblogic 8.1.
On this server, I've deployed two EARs, each of them having packages beginning
with prefix empo.*

For instance, in EAR #1, I'll have a class called empo.app1.admin.ParseFile
and in EAR #2, I'll have a class empo.app2.admin.ParseXML

Each EAR has it's own log4j jar file embedded. (I didn't design the way the
applications are organized)

The log4j.properties file is defined at the domain root (so in the BEA server)
and the logs are rather general :
log4j.category.empo=DEBUG, APPLI
log4j.additivity.empo=false

log4j.appender.APPLI=org.apache.log4j.DailyRollingFileAppender
log4j.appender.APPLI.File=C:/logs/EMPO_APPLI.log
log4j.appender.APPLI.datePattern='.'yyyy-MM-dd'.log'
log4j.appender.APPLI.append=true
log4j.appender.APPLI.layout=org.apache.log4j.PatternLayout
log4j.appender.APPLI.layout.ConversionPattern=<%d> <%-5p> <%C:%L> - %m%n

When tested individualy, each application works very fine and is correctly
logged.

But when I access to both applications, the file is created with the first
application and when I access to the second one, it overwrites the file (so the
logs of appli1 is lost). The result is impredicatable.

My idea is that the LOG4J class from app1 locks the file, then the LOG4J from
app2 tries to access it.

Anyone has an idea so that the classes in both EARs can share the same log file
?

Thanks a lot

maxence-

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Weblogic - Concurrent access of the same appender by dif. applications

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Maxence Terzan <ma...@etudiant.univ-lille1.fr>:

> Jacob Kjome <hoju <at> visi.com> writes:
>
> > Are the EAR's both running in the same JVM?  Do you have append="true" in
> the
> > config for the file appenders?  I would think it would work you have all
> this
> > set up correctly.
> >
> > Jake
>
> The EAR are running in the same JVM. (The one of Weblogic's server).
> [Actually, clustering is used so I make the test on one instance of the
> cluster]
>
> And yes, I did specify append="true".
>
> The problem doesn't appear on my local machine but when I deploy it on the
> production server, the applications are not correctly logged.
>
> I wonder if the fact that in each EAR, I use a log4j jar file that writes in
> the
> same log file isn't the cause of the trouble...
>

First, I wish you hadn't remove the original text of the conversation.  I don't
fully remember what you originally wrote.  I'll answer from what I can
remember...

Well, I guess I would recommend that different applications write to different
log files but, ultimately, it shouldn't matter if this is happening in the same
JVM.  Two separate JVM's would end up with file locking contention, but the same
JVM should be fine.  I wonder if you have another config file that is being used
for one or both apps that you didn't realize.  It might not have append=true.


Jake

> Maxence-
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Weblogic - Concurrent access of the same appender by dif. applications

Posted by Maxence Terzan <ma...@etudiant.univ-lille1.fr>.
Jacob Kjome <hoju <at> visi.com> writes:

> Are the EAR's both running in the same JVM?  Do you have append="true" in the
> config for the file appenders?  I would think it would work you have all this
> set up correctly.
> 
> Jake

The EAR are running in the same JVM. (The one of Weblogic's server).
[Actually, clustering is used so I make the test on one instance of the cluster]

And yes, I did specify append="true".

The problem doesn't appear on my local machine but when I deploy it on the
production server, the applications are not correctly logged.

I wonder if the fact that in each EAR, I use a log4j jar file that writes in the
same log file isn't the cause of the trouble...

Maxence-


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Weblogic - Concurrent access of the same appender by dif. applications

Posted by Jacob Kjome <ho...@visi.com>.
Are the EAR's both running in the same JVM?  Do you have append="true" in the
config for the file appenders?  I would think it would work you have all this
set up correctly.

Jake

Quoting Maxence.Terzan@etudiant.univ-lille1.fr:

> Hello,
>
> I'm currently using Weblogic 8.1.
> On this server, I've deployed two EARs, each of them having packages
> beginning
> with prefix empo.*
>
> For instance, in EAR #1, I'll have a class called empo.app1.admin.ParseFile
> and in EAR #2, I'll have a class empo.app2.admin.ParseXML
>
> Each EAR has it's own log4j jar file embedded. (I didn't design the way the
> applications are organized)
>
> The log4j.properties file is defined at the domain root (so in the BEA
> server)
> and the logs are rather general :
> log4j.category.empo=DEBUG, APPLI
> log4j.additivity.empo=false
>
> log4j.appender.APPLI=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.APPLI.File=C:/logs/EMPO_APPLI.log
> log4j.appender.APPLI.datePattern='.'yyyy-MM-dd'.log'
> log4j.appender.APPLI.append=true
> log4j.appender.APPLI.layout=org.apache.log4j.PatternLayout
> log4j.appender.APPLI.layout.ConversionPattern=<%d> <%-5p> <%C:%L> - %m%n
>
> When tested individualy, each application works very fine and is correctly
> logged.
>
> But when I access to both applications, the file is created with the first
> application and when I access to the second one, it overwrites the file (so
> the
> logs of appli1 is lost). The result is impredicatable.
>
> My idea is that the LOG4J class from app1 locks the file, then the LOG4J from
> app2 tries to access it.
>
> Anyone has an idea so that the classes in both EARs can share the same log
> file
> ?
>
> Thanks a lot
>
> maxence-
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org