Re: Configuring Tomcat to use log4j2 - not working, probably a, trivial error in log4j2.xml

2022-01-10 Thread Bruno Melloni
Answering myself... it is as simple as putting all of those jars and 
conf folder in the Java Classpath used to launch Tomcat, it ends up 
showing inside of Tomcat too, so it ends up working fine even if the 
configuration is a bit ugly.


On 1/10/2022 11:27 AM, Bruno Melloni wrote:

Update:

So, I had got it to work by putting the following code in catalina.bat.
Then based on the recommendations on this thread I removed it from
catalina.bat and created a setenv.bat with the exact same lines.

rem LOG4J config
set 
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-api-2.17.1.jar"
set 
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-core-2.17.1.jar"

set
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-appserver-2.17.1.jar" 


set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\conf"

Works like a charm from the command line but gets ignored when launched
as a windows service.

I could not find the syntax for adding things (like log4j) to the
classpath on tomcat9w, does anybody know what it is?


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



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



Re: Configuring Tomcat to use log4j2 - not working, probably a, trivial error in log4j2.xml

2022-01-10 Thread Bruno Melloni

Update:

So, I had got it to work by putting the following code in catalina.bat.
Then based on the recommendations on this thread I removed it from
catalina.bat and created a setenv.bat with the exact same lines.

rem LOG4J config
set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-api-2.17.1.jar"
set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-core-2.17.1.jar"
set
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-appserver-2.17.1.jar"
set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\conf"

Works like a charm from the command line but gets ignored when launched
as a windows service.

I could not find the syntax for adding things (like log4j) to the
classpath on tomcat9w, does anybody know what it is?


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



Re: Configuring Tomcat to use log4j2 - not working, probably a trivial error in log4j2.xml

2022-01-06 Thread Bruno Melloni

Success!

The issue turned out to be that placing the log4j2 jars and 
log4j2-tomcat.xml in the tomcat/lib folder no longer works.


The solution:

 * Followed the official instructions to the letter
   (https://logging.apache.org/log4j/2.x/log4j-appserver/index.html)
 * Used this canned log4j2-tomcat.xml file that replicates the original
   tomcat files but using log4j
   (https://gist.github.com/bmaupin/475a0cd6e8b374d876f5085846761fb6)
 * Could not edit setenv.sh in Windows (does not exist), so instead I
   added the following (knowingly ugly and inflexible code - for now)
   to catalina.bat:

 * set
   "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-api-2.17.1.jar"
 * set
   "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-core-2.17.1.jar"
 * set
   
"CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\lib\log4j-appserver-2.17.1.jar"
 * set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\log4j2\conf"

It now puts all of Tomcat's logging in the files, with virtually nothing 
in the console.


I hope the solution (or an improved version of this) helps others.

bruno

On 1/6/2022 5:34 PM, Ralph Goers wrote:

I haven’t checked Tomcat 9, but the log4j-appserver module was created to hook 
into Tomcat 8.5 and up. I just not sure if Tomcat changed their logging 
mechanism yet again.

Ralph


On Jan 6, 2022, at 2:43 PM, Bruno Melloni  wrote:

A correction, after doing more troubleshooting and using even the
original log4j2.xml (on the previous install) it seems that the old
version was logging nothing to the files from Tomcat itself, and was
displaying everything on the console instead... in whatever mechanism it
wanted, so only my own apps were logging to the log4j files, with the
Tomcat output getting lost.

So, the problem remains, it is not clear at all how you configure Tomcat
9 to use log4j2 after all, and none of the guides on the internet are
complete enough to follow verbatim.

On 1/6/2022 11:37 AM, Bruno Melloni wrote:

A couple months ago I had no problem configuring Tomcat 9 with java 16 to use 
log4j2.

That time I simply deleted tomcat/conf/*logging.properties*, added to 
*tomcat/lib* the following files and it worked.

  * log4j-api-2.*.jar
  * log4j-core-2.*.jar
  * log4j-appserver-2.*.jar
  * log4j2.xml

Now I am setting up a new tomcat 9.0.56 with java 17 and log4j 2.17.1, followed 
the same steps with one difference... I tweaked the log4j2.xml to try to make 
it cleaner and easier to maintain/adjust.

Unfortunately my new setup is failing to log anything at all. The only place 
where I see something is on the console and it looks like it is not even log4j 
output as it does not match the pattern I expected.  I think I am 
misunderstanding something about the use of properties in a log4j2.xml file or 
I have some really dumb typo.

I hope someone can give a glance at the following and tell me where I messed up:


 
   
 D:/work/app-j17t9-C/logs
 D:/work/app-j17t9-C/logs/archive
 D:/work/app-j17t9-C/logs/server
 D:/work/app-j17t9-C/logs/server/archive
 %d %-5p [%C] %m%n
 10 MB
   
   
 
   
 
 
   
   


   
   
 
 
   
   


   
   
 
 
 
   
   


   
   
 
 
   
   


   
   
 
 
   
   


   
   
 
 
   
   


   
   
 
   
   
 
 
   
   
 
 
 
   
   
 
 
 
 
 
   
 
 
   
 
 
   
 
  
   
 
   



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




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


Re: Configuring Tomcat to use log4j2 - not working, probably a trivial error in log4j2.xml

2022-01-06 Thread Bruno Melloni

A correction, after doing more troubleshooting and using even the
original log4j2.xml (on the previous install) it seems that the old
version was logging nothing to the files from Tomcat itself, and was
displaying everything on the console instead... in whatever mechanism it
wanted, so only my own apps were logging to the log4j files, with the
Tomcat output getting lost.

So, the problem remains, it is not clear at all how you configure Tomcat
9 to use log4j2 after all, and none of the guides on the internet are
complete enough to follow verbatim.

On 1/6/2022 11:37 AM, Bruno Melloni wrote:
A couple months ago I had no problem configuring Tomcat 9 with java 16 
to use log4j2.


That time I simply deleted tomcat/conf/*logging.properties*, added to 
*tomcat/lib* the following files and it worked.


 * log4j-api-2.*.jar
 * log4j-core-2.*.jar
 * log4j-appserver-2.*.jar
 * log4j2.xml

Now I am setting up a new tomcat 9.0.56 with java 17 and log4j 2.17.1, 
followed the same steps with one difference... I tweaked the 
log4j2.xml to try to make it cleaner and easier to maintain/adjust.


Unfortunately my new setup is failing to log anything at all. The only 
place where I see something is on the console and it looks like it is 
not even log4j output as it does not match the pattern I expected.  I 
think I am misunderstanding something about the use of properties in a 
log4j2.xml file or I have some really dumb typo.


I hope someone can give a glance at the following and tell me where I 
messed up:



 

  
    D:/work/app-j17t9-C/logs
    name="appsarchivedir">D:/work/app-j17t9-C/logs/archive
    name="serverlogdir">D:/work/app-j17t9-C/logs/server
    name="serverarchivedir">D:/work/app-j17t9-C/logs/server/archive

    %d %-5p [%C] %m%n
    10 MB
  
  
    
  
    
    filePattern="${appsarchivedir}/$${date:-MM}/apps-%d{MM-dd-}-%i.log.gz"> 


  
  
   
   
  
  
    
    filePattern="${appsarchivedir}/$${date:-MM}/email-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    
    fileName="${serverlogdir}/catalina.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/catalina-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    fileName="${serverlogdir}/localhost.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/localhost-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    filePattern="${serverarchivedir}/$${date:-MM}/manager-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    fileName="${serverlogdir}/host-manager.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/host-manager-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
  
  
    
    
  
  
    
    
    
  
  
    
    
    
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" 
level="info" additivity="false">

  
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]" 
level="info" additivity="false">

  
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]" 
level="info" additivity="false">

  
    
    additivity="false"> 

  
    
  




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



Configuring Tomcat to use log4j2 - not working, probably a trivial error in log4j2.xml

2022-01-06 Thread Bruno Melloni
A couple months ago I had no problem configuring Tomcat 9 with java 16 
to use log4j2.


That time I simply deleted tomcat/conf/*logging.properties*, added to 
*tomcat/lib* the following files and it worked.


 * log4j-api-2.*.jar
 * log4j-core-2.*.jar
 * log4j-appserver-2.*.jar
 * log4j2.xml

Now I am setting up a new tomcat 9.0.56 with java 17 and log4j 2.17.1, 
followed the same steps with one difference... I tweaked the log4j2.xml 
to try to make it cleaner and easier to maintain/adjust.


Unfortunately my new setup is failing to log anything at all. The only 
place where I see something is on the console and it looks like it is 
not even log4j output as it does not match the pattern I expected.  I 
think I am misunderstanding something about the use of properties in a 
log4j2.xml file or I have some really dumb typo.


I hope someone can give a glance at the following and tell me where I 
messed up:



 

  
    D:/work/app-j17t9-C/logs
    name="appsarchivedir">D:/work/app-j17t9-C/logs/archive
    name="serverlogdir">D:/work/app-j17t9-C/logs/server
    name="serverarchivedir">D:/work/app-j17t9-C/logs/server/archive

    %d %-5p [%C] %m%n
    10 MB
  
  
    
  
    
    filePattern="${appsarchivedir}/$${date:-MM}/apps-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    filePattern="${appsarchivedir}/$${date:-MM}/email-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    
    fileName="${serverlogdir}/catalina.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/catalina-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    fileName="${serverlogdir}/localhost.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/localhost-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    filePattern="${serverarchivedir}/$${date:-MM}/manager-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
    fileName="${serverlogdir}/host-manager.txt" 
filePattern="${serverarchivedir}/$${date:-MM}/host-manager-%d{MM-dd-}-%i.log.gz">

  
  
   
   
  
  
    
  
  
    
    
  
  
    
    
    
  
  
    
    
    
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" 
level="info" additivity="false">

  
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]" 
level="info" additivity="false">

  
    
    name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]" 
level="info" additivity="false">

  
    
     


  
    
  



forcing [root] logging - to a separate appender

2012-04-03 Thread BRUNO MELLONI
I support a server that uses log4j.  Of the many applications on it, a few dump 
their logs as [root] log4j entries.

I would like to setup a category or even separate appender that allows me to 
control and/or separate these bad log entries.  The problem is that I only want 
to affect things "just at the root", not every single package in the server.

How would I write such a category or appender configuration?

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



RE: Problems with log4j configuration

2012-01-23 Thread BRUNO MELLONI
Looks right to me, but I don't remember the RollingFileAppender parameters.

I suggest you:

1) Look in server.log and see if your entries might be going there.
2) Check for typos.
3) Try implementing your AUDITOR appender by cut/pasting the FILE appender that 
is there as a starting point.
4) Instead of using static and specifying the class use "private final Logger 
logger = Logger.getLogger(this.getClass());"

-Original Message-
From: rhaiger [mailto:rhai...@gmail.com] 
Sent: Monday, January 23, 2012 1:45 PM
To: log4j-user@logging.apache.org
Subject: Problems with log4j configuration


Hello guys, I'm new in this forum and I think you may help me with an issue...

I'm trying to use log4j to log some login auditing informations, and I'm using 
JBoss 4 and Java with compliance level 5.0. It's a very old legacy system...

I've added this lines at my log4j.xml:









   







And in my Foo.java class, I've added this field:

private static final Logger logger = Logger.getLogger(Foo.class);

When I want to log something (inside my Foo.java class), I just call my logger 
with something like:

logger.info("any message");


Well, after that, I start JBoss4, and I can see that Auditor.log file is 
created in my log folder, as it should be, but everything I try to log doesn't 
appear in my Auditor.log file... :-(

When I start my application in debug mode, I can see that I'm passing through 
several loggers that I've put in my Foo.java class, but it seems that log4j is 
just ignoring these callings and nothing is logged at all...

Does anyone know what's happening? It seems to be something really simple, but 
I can't figure it out! :-((

Thanks from now and best regards! :-)
--
View this message in context: 
http://old.nabble.com/Problems-with-log4j-configuration-tp33190553p33190553.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


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



RE: Log4j and Java7/JDBC4.1's CommonDataSource.getParentLogger()

2012-01-12 Thread BRUNO MELLONI
I am not following.  I already have slf4j in my stack (needed by other 
libraries), although I've written no code that directly interacts with it.

I assume that you are telling me to implement getParentLogger() in my 
datasource (so that it compiles in Java7) and that I should put a couple lines 
of code based on slf4j to get that parent logger so that it really is 
reflecting the log4j logger.  

The obvious dumb question is... what would that code look like?

-Original Message-
From: Douglas E Wegscheid [mailto:douglas_e_wegsch...@whirlpool.com] 
Sent: Thursday, January 12, 2012 6:51 AM
To: Log4J Users List
Cc: log4j-user@logging.apache.org
Subject: Re: Log4j and Java7/JDBC4.1's CommonDataSource.getParentLogger()

I have hit the same situation with software that requires use of Apahce commons 
logging, I use slf4j (and have it feed log4j); it has adapters to let you log 
from j.u.l and commons logging. I don't know if it's best practice, but it 
certainly works.
■ DOUGLAS E. WEGSCHEID // LEAD ENGINEER
(269) 923-5278 // douglas_e_wegsch...@whirlpool.com "A wrong note played 
hesitatingly is a wrong note. A wrong note played with conviction is 
interpretation."



BRUNO MELLONI 
01/11/2012 05:56 PM
Please respond to
"Log4J Users List" 


To
"log4j-user@logging.apache.org" 
cc

Subject
Log4j and Java7/JDBC4.1's CommonDataSource.getParentLogger()






Just upgraded from Java 6 to Java 7 and got a nasty surprise.

I have a class that extends from JDBC's AbstractDataSource.  Java 
7/JDBC4.1 requires implementing  the abstract method getParentLogger() 
from CommonDataSource.  The method returns a java.util.logging.Logger, but 
I use log4j.

I imagine that this problem has been encountered before and solved.

What is the best practice solution?




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



Log4j and Java7/JDBC4.1's CommonDataSource.getParentLogger()

2012-01-11 Thread BRUNO MELLONI
Just upgraded from Java 6 to Java 7 and got a nasty surprise.

I have a class that extends from JDBC's AbstractDataSource.  Java 7/JDBC4.1 
requires implementing  the abstract method getParentLogger() from 
CommonDataSource.  The method returns a java.util.logging.Logger, but I use 
log4j.

I imagine that this problem has been encountered before and solved.

What is the best practice solution?



RE: How to roll the file based on size and time?

2010-02-19 Thread Bruno Melloni
I know I'll again be writing a unified DailyRollingFile/RollingFile appender 
for my current job in the future.  

Is there any chance to get it included into the main distribution if I 
contribute it?  If yes, what standards would it have to adhere to?

I would rather contribute it than keep rewriting it every time I change jobs.  
And my current company is probably the first that I'm working at that would not 
object to me contributing a piece of code like this one even though it would be 
built on their clock.

b.

-Original Message-
From: Michael Erskine [mailto:mse...@googlemail.com] 
Sent: Friday, February 19, 2010 8:54 AM
To: Log4J Users List
Subject: Re: How to roll the file based on size and time?

On 19 February 2010 14:08, Bruno Melloni  wrote:
> Indeed, I once wrote my own and it wasn't too hard.
> Still, it is surprising that an appender for such a common need was never 
> included in the basic set.

It is not surprising when you try to fulfil _everybody's_ needs :)

I know -- I tried -- I quit! My quicker solution was to write a little
helper class for the standard DailyRollingFileAppender that applied a
"maxBackup" property to limit the number of days' logs to be retained
to avoid disks filling up. I didn't attempt to limit the amount of
data stored in each file like the RollingFileAppender maxFileSize
property or an of the other complexities.

I shudder to think of the comprehensive unit test suite to thoroughly
validate and verify a unified DailyRollingFile/RollingFile appender.

Regards,
Michael Erskine.

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


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



RE: How to roll the file based on size and time?

2010-02-19 Thread Bruno Melloni
Indeed, I once wrote my own and it wasn't too hard. 

Still, it is surprising that an appender for such a common need was never 
included in the basic set.

-Original Message-
From: Maarten Bosteels [mailto:mbosteels@gmail.com] 
Sent: Friday, February 19, 2010 2:47 AM
To: Log4J Users List
Subject: Re: How to roll the file based on size and time?

Not that I know of.
But it's easy to write your own RollingPolicy. For inspiration, have a look
at org.apache.log4j.rolling.TimeBasedRollingPolicy

Maarten

On Fri, Feb 19, 2010 at 9:26 AM, Yong-Loh wrote:

>
> Hi All,
>
> We are using log4j framework. Our requirement is, we should roll the file
> based on size and time.
>
> We have RollingFileAppender and DailyRollingFileAppender for doing these
> separately.
>
> Is there any appender available in log4j for doing both of these?
>
> Thanks & Regards,
> Yong-Loh
> --
> View this message in context:
> http://old.nabble.com/How-to-roll-the-file-based-on-size-and-time--tp27650975p27650975.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>


RE: Split logging by class/package

2010-01-19 Thread Bruno Melloni
Thanks for reminding me of the additivity flag.  It doesn't solve the problem 
100% but allowed me to come pretty close in a very easy way:

- Created MYCLASS appender that writes to MyClass.log.
- Created a  entry as follows:

   
  
  
   

This separated all of the output of MyClass to MyClass.log.  What remains to be 
done is to make MyClass' log entries of level INFO and higher return to the 
main log.  

I wish we could just define a second  entry for "mypackage.MyClass" - 
with priority="INFO" and appender-ref pointing to the main appender.  But log4j 
isn't there yet.

bruno

-Original Message-
From: Brett Randall [mailto:javabr...@gmail.com] 
Sent: Sunday, January 17, 2010 3:36 AM
To: Log4J Users List
Subject: Re: Split logging by class/package

Bruno, have you tried setting the additivity flag for the MyClass logger to
"false"? Not sure if it meets all your needs, but it would allow you to
attach an appender to the MyClass logger and prevent propagation to ancestor
loggers and their appenders.

Brett

On Sat, Jan 16, 2010 at 3:37 AM, Bruno Melloni
wrote:

> All examples on how to split logging across two appenders seem to be 'by
> level', and the XML configuration only has one set of  definitions
> rather than one set per appender.  I need to split logging by both class and
> level:
>
>
> -  Default log:  Standard logging for the application, including
> log entries for 'MyClass' at INFO level and above.
>
> -  MyClass log:  Entries for MyClass only, at DEBUG level.  It
> would be acceptable if it also contained MyClass higher logging levels.
>
> My need seems to be pretty standard.  Is there a simple way to do this?
>
> The only solution I found (but not tried) seems too complicated to be
> right:
>
>
> -  Setup the category for MyClass at DEBUG level.
>
> -  Create a MyClass appender in log4j.xml.
>
> -  Write a custom Filter that only accepts MyClass log entries of
> DEBUG level.  Add the filter to the MyClass appender.
>
> -  Write a custom Filter that accepts all log entries except
> MyClass DEBUG entries.  Add the filter to the default appender.
>
> -  Since I am using jBoss' logging facility, place these classes
> 'somewhere' that puts them in jBoss' classpath.  Where would that be?
>
> Any guidance would be greatly appreciated.
>

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



Split logging by class/package

2010-01-15 Thread Bruno Melloni
All examples on how to split logging across two appenders seem to be 'by 
level', and the XML configuration only has one set of  definitions 
rather than one set per appender.  I need to split logging by both class and 
level:


-  Default log:  Standard logging for the application, including log 
entries for 'MyClass' at INFO level and above.

-  MyClass log:  Entries for MyClass only, at DEBUG level.  It would be 
acceptable if it also contained MyClass higher logging levels.

My need seems to be pretty standard.  Is there a simple way to do this?

The only solution I found (but not tried) seems too complicated to be right:


-  Setup the category for MyClass at DEBUG level.

-  Create a MyClass appender in log4j.xml.

-  Write a custom Filter that only accepts MyClass log entries of DEBUG 
level.  Add the filter to the MyClass appender.

-  Write a custom Filter that accepts all log entries except MyClass 
DEBUG entries.  Add the filter to the default appender.

-  Since I am using jBoss' logging facility, place these classes 
'somewhere' that puts them in jBoss' classpath.  Where would that be?

Any guidance would be greatly appreciated.


How does log4j fail?

2008-10-28 Thread Bruno Melloni
We have an application that does massive logging (about 100GB per day),
and log4j works like a charm.  We manage disk allocation to the log
filesystem fairly well, but nobody is perfect.  Since the application is
mission critical, we want to be 100% sure that logging failures won't
stop it.

So the question is:

When log4j is unable to log, how does it fail?  Does it just stop
logging? (which would be OK) Or does it crash/hang the application?

We'd be very interested in finding the answer for at least two
scenarios:

1) Using a file-based appender and running out of disk space. 
Having the appender (yes, it is custom) check for free space is not a
good option since the app is running on jdk 1.5.  Migrating to jdk 1.6
is no viable at this time, and constantly spawning a Solaris 'df -k
' is not very desirable.

2) Delegating logging to a separate box dedicated to logging, and use
something like a SocketAppender or other distributed mechanism.  In such
a scenario we could loose the box, network, etc... So the focus would be
on how would the Appender would die/stop-logging.  This would probably
be easier to custom-code if necessary.

Thanks,

bruno

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problem with FileAppender

2008-10-28 Thread Bruno Melloni
>From your comments I think that you meant to use the RollingFileAppender
and used the FileAppender instead.  The RollingFileAppender supports
multiple files, with maximum file size and maximum number of backups.

bruno 

-Original Message-
From: Wagner, Stefan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 28, 2008 9:31 AM
To: log4j-user@logging.apache.org
Subject: Problem with FileAppender

Hey Folk,

 

we use log4j in many JSF projects, great framework. But on one system
the FileAppender works wrong in our system...

 

Here is my test configuration:

log4j.rootLogger=warn, R

log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=./logs/example.log

log4j.appender.R.MaxFileSize=10KB # sure, normally that's s

# Keep one backup file

log4j.appender.R.MaxBackupIndex=10

log4j.appender.R.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 

I tried everything, I just get one growing file (example.log), no
example.1, example.2 etc...

Also the file logs infos, although I changed it to warn level

But the information about the file location was used, even when I
changed it. (log4j.appender.R.File)

Is this a knewn phenomenon? Or could this be a problem of my system?

 

Thanks a lot

Stefan

 

 

_
Sitz der Gesellschaft: Viernheim

Geschaftsfuhrer: Jurgen Gerbig, Werner Oestreicher

Amtsgericht: Darmstadt, Registerabteilung: Lampertheim, HRB 61943,
USt-IdNr.: DE148419070

Diese Email enthalt vertrauliche und/oder rechtlich geschutzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtumlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist
nicht gestattet.
 
This message is confidential and may contain privileged information. If
you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden. 

Versand am 28.10.2008 15:31 von Wagner, Stefan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dual logging problem - outofmemoryerror... heap space

2008-10-08 Thread Bruno Melloni
This might be a dumb question/answer... but instead of using the spy
class, why not stick to the RollingFileAppender and simply increase the
max file size or the number of backup files kept, so that you keep
enough logs?
 
Or, if you don't have the disk space, why not use the finer grain
control - by package or class - in log4j.properties so that you only
send to the logs the 'critical information' instead of everything?  That
way your logs will be smaller.
 
BTW, you may even have an unrelated memory leak that is reducing the
memory available to log4j. 
 
bruno
 


From: Johan Sandgren [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 08, 2008 3:20 AM
To: log4j-user@logging.apache.org
Subject: Dual logging problem - outofmemoryerror... heap space



 

Hi,

 

Need advice from professionals here... I'm stuck! L

 

I'm using log4j, and my logs are rotating quite fast, so if an error
occurs, for example in the middle of the night, it will not be present
in the log in the morning when I arrive to check for errors.

 

So I decided to extract the errors live, when they occur, and make them
go to another file.

But since errors just on their own does not say much of where the
program were and what was the variables right then, I'd also like to
attach some history before the error in the error.log-file.

 

So I wrote a class to support this feature. It's a spy really. It's
attaching to an existing logger, and adding another appender, which I
use to create history and outputting to another error.log-file when I
need to.

 

 

A little more details on the spyclass are:

 

I'm calling my usual logger X, and I've created another loggerclass Y,
which attaches another appender on my X.

 

For each logger call with X, I also call my Y which is getting the
string too, because it's snooping on X, via this appender I added. Y is
also keeping a circularbuffer of history of all logging it gets.

When Y is called with error, fatal or warn, it will do a dump of the
history and lastly, the erranous line, and all this to another file,
error.log.

 

That way I will get my usual log in blabla.log, and for each warn, error
/fatal, I get a few lines of history + the error/warn/fatal-line that is
to be noticed.

 

 

My problem:

BUT, I get out of heapmemory when using it after a while.

I cannot find the error causing it. Mayber I'm misusing the appender or
log4j?

 

I've attached the historymaking class "ErrorLogger.java", and an example
(test.java) of how the calls are made.

 

 

 

Exception in thread "Thread-5" java.lang.OutOfMemoryError: Java heap
space

at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.jav
a:99)

at
java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)

at java.lang.StringBuffer.append(StringBuffer.java:225)

at java.io.StringWriter.write(StringWriter.java:79)

at
org.apache.log4j.helpers.QuietWriter.write(QuietWriter.java:47)

at
org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301)

at
org.apache.log4j.WriterAppender.append(WriterAppender.java:159)

at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)

at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(Ap
penderAttachableImpl.java:65)

at org.apache.log4j.Category.callAppenders(Category.java:203)

at org.apache.log4j.Category.forcedLog(Category.java:388)

at org.apache.log4j.Category.debug(Category.java:257)

 

at
com.sttcare.alarmSwitch.JmsTester.activeMqIsUp(JmsTester.java:88) calls
connection.stop(); So it really has nothing with log4j, I guess the heap
is just ended right then.

 

at
com.sttcare.alarmSwitch.systemWatch.ProgramChecker.activeMQWorks(Program
Checker.java:143)

at
com.sttcare.alarmSwitch.systemWatch.ProgramChecker.run(ProgramChecker.ja
va:119)

at java.lang.Thread.run(Thread.java:595)

 

 

Seems to me something is exandCapacity too much... 

 

/Johan

 

___

Johan Sandgren

Svep Design Center AB

Phone +46 46 192 722

Mobile +46 70 173 4152

Box 1233, 221 05 Lund, Sweden  

E-mail   [EMAIL PROTECTED]

Website www.svep.se  

 



RE: Logging from appender

2008-09-11 Thread Bruno Melloni
The disk utilization check is called form inside the 'append' process...
that is why it would be messy.  

As I said in the original email, there probably is a specific Log
class/method already in log4j intended for logging from inside an
appender.  It would be consistent with log4j's design.  But I can't seem
to find that class/method.

Thanks for trying anyway.  

bruno

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2008 11:21 AM
To: Log4J Users List
Subject: RE: Logging from appender

I'm using a RollingFileAppender in my logging.  It extends FileAppender,
which extends WriterAppender.  The WriterAppender has an "append" method
which takes a LoggingEvent object as a parameter.  Is your appender a
subclass of WriterAppender or some other class that extends
WriterAppender?  You could maybe call the "append" method and send your
LoggingEvent?

Again, I'm fairly new to log4j.
(Embedded image moved to file: pic11478.jpg)



 

 "Bruno Melloni"

 <[EMAIL PROTECTED]

 .com>
To 
 "Log4J Users List"

 09/11/2008 12:13 PM 

 
cc 
 

  Please respond to
Subject 
 "Log4J Users List"  RE: Logging from appender

 <[EMAIL PROTECTED]

.apache.org>

 

 

 

 





Sorry, I think I got misunderstood.  I have no problem with
levels/thresholds when logging from the app.

What I want to do is generate an additional log message from INSIDE the
appender code, WHILE it is about to process an application message.

bruno

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 11, 2008 10:59 AM
To: Log4J Users List
Subject: Re: Logging from appender

I'm not an expert on Log4j, but recently had a similar requirement.  I
didn't want debug messages appearing on the console.  So on my console
appender, I set a threshold like this:

log4j.appender.CA.Threshold=INFO

I got that from somebody else on this list.  This way I only see INFO
messages and above on the console and I see everything in my log file
from debug up.  If you did the same but set the threshold above WARN,
the console will only show messages above WARN, however you won't see
anything less than or equal to WARN on the console.  Don't know if that
helps.  I think the log4j configuration in XML allows for a min and max
threshold.
(Embedded image moved to file: pic17673.jpg)





 "Bruno Melloni"

 <[EMAIL PROTECTED]

 .com>
To
 "Log4J Users List"

 09/11/2008 11:53 AM 


cc


  Please respond to
Subject
 "Log4J Users List"  Logging from appender

 <[EMAIL PROTECTED]

.apache.org>













What is the best way to send a message to the log from inside the
Appender itself?  (separate from the message that the appender is
currently processing)

Why do I even ask this?  My appender checks disk utilization every hour.
I'd like to record the % of disk utilized in the log.

I tried using LogLog.warn(), but it puts the message on the console, not
in the log file generated by the appender.  I could probably add it
manually to the code that writes to the file, but that feels messy...
and I suspect that there's built-in log4j functionality for what I want
to do.

bruno


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Logging from appender

2008-09-11 Thread Bruno Melloni
Sorry, I think I got misunderstood.  I have no problem with
levels/thresholds when logging from the app.

What I want to do is generate an additional log message from INSIDE the
appender code, WHILE it is about to process an application message. 

bruno

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2008 10:59 AM
To: Log4J Users List
Subject: Re: Logging from appender

I'm not an expert on Log4j, but recently had a similar requirement.  I
didn't want debug messages appearing on the console.  So on my console
appender, I set a threshold like this:

log4j.appender.CA.Threshold=INFO

I got that from somebody else on this list.  This way I only see INFO
messages and above on the console and I see everything in my log file
from debug up.  If you did the same but set the threshold above WARN,
the console will only show messages above WARN, however you won't see
anything less than or equal to WARN on the console.  Don't know if that
helps.  I think the log4j configuration in XML allows for a min and max
threshold.
(Embedded image moved to file: pic17673.jpg)



 

     "Bruno Melloni"

 <[EMAIL PROTECTED]

 .com>
To 
 "Log4J Users List"

 09/11/2008 11:53 AM 

 
cc 
 

  Please respond to
Subject 
 "Log4J Users List"  Logging from appender

 <[EMAIL PROTECTED]

.apache.org>

 

 

 

 





What is the best way to send a message to the log from inside the
Appender itself?  (separate from the message that the appender is
currently processing)

Why do I even ask this?  My appender checks disk utilization every hour.
I'd like to record the % of disk utilized in the log.

I tried using LogLog.warn(), but it puts the message on the console, not
in the log file generated by the appender.  I could probably add it
manually to the code that writes to the file, but that feels messy...
and I suspect that there's built-in log4j functionality for what I want
to do.

bruno


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logging from appender

2008-09-11 Thread Bruno Melloni
What is the best way to send a message to the log from inside the
Appender itself?  (separate from the message that the appender is
currently processing)
 
Why do I even ask this?  My appender checks disk utilization every hour.
I'd like to record the % of disk utilized in the log.  
 
I tried using LogLog.warn(), but it puts the message on the console, not
in the log file generated by the appender.  I could probably add it
manually to the code that writes to the file, but that feels messy...
and I suspect that there's built-in log4j functionality for what I want
to do.
 
bruno


RE: network logging performance

2008-09-04 Thread Bruno Melloni
**Theoretically**, a logging event should be a 'fire and forget'
activity from the perspective of the application.  That means that you
should be able to submit the logging event to the 'logging system'
without blocking, and then the 'logging system' should be able to
deliver those logging events to the final destination on its own
thread(s) and at its own speed.  As long as the average volume of
logging does not exceed the capacity of the actual logging mechanism
(i.e.: over the network) then there ought to be no impact whatsoever to
the application (except perhaps for the cpu overhead of the physical
logging thread(s)).

I don't know log4j well enough to say whether it is already doing this
isolation of 'log event submission' vs 'log event processing'.  If it
doesn't, you should be able to have your application submit all logging
requests through a class written by you that puts all requests into a
memory cache, ensuring no blocking.  Then have one or more separate
threads handling the 'log event processing' independently from the rest
of the app.  For safety, you should probably add some code that monitors
memory, disk and network utilization by this approach and notify you
(perhaps by email) when things get backed up - that way you'll detect
any volume-caused issues before they have a chance to impact the app.

If you really wanted to be bulletproof, implement the cache to use
memory first (up to some limit) and then overflow to a local file cache.
That way if your network gets bogged down by issues other than your
app's you would still be able to continue functioning while the network
recovers.

I know that did not answer your immediate question, but it should help
some in making your choices.

bruno

-Original Message-
From: Paul Smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 03, 2008 8:31 PM
To: Log4J Users List
Subject: network logging performance

If anyone out there is using "Logging over the network" of any form
(socket, JMS, Multicast, syslog appenders etc), this topic is for you.  
I'm wondering whether people could comment on their experience setting
up high performance logging of application data over the network.  The
cost of shipping an event over the wire compared with writing it to a
local file is obviously higher, and so one can notice user-visible
impact if the logging volume is high when using network-based logging
(unless one wraps it in AsyncAppenders).

Just curious to hear peoples experiences, strategies, and thoughts.   
Perhaps people can relate to the flow rate they've manage to achieve
under different configurations.

The driver to my question is that for my Apache Lab project (Pinpoint)
I'm building a central logging repository server to allow data mining of
the generated logging events.  In a high performance site one can have
many logging events shipped from multiple threads in, say, a web- app,
being shipped serially over the wire, so slowing down the logging can
slow down the response time.

cheers,

Paul Smith

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: New Appender: PatternFileAppender

2008-09-03 Thread Bruno Melloni
Seems that several of us have been looking at similar things.  

I looked at the MultiFile appender but it wasn't quite flexible enough,
so I created another appender similar to this
(DynamicTimestampedFileAppender)  and was debating whether to submit it.
It is complete but has only been in use for under a week.  Please let me
know if I should submit it, or perhaps the three appenders ought to be
compared and eventually create a hybrid appender that replaces them all.

Key features:

- Designed as a full lifecycle file appender.  
- Instead of sequence numbers uses timestamps of file creation (much
easier to find entries).  Rollovers are really nothing more than closing
a file and creating a new one.
- Zips and deletes old files.  Zips and deletes happen at night and
server start (minimizes load when server is running).
- Multiple logging file sets are dynamically generated.
- Has built-in variables that can be used in defining the file names.
- Additional variables can be defined by parsing the message through
regular expressions.
- Has a maximum file size, but it can be overridden with a minimum
amount of time between rollovers (i.e.: 1 hour).
- Extra rollovers occur at midnight and at a specified time (i.e.:
3:00am), allowing for clear separation of logs by 'operating window'.

log4j.properties instructions and sample setup data:

#   basePath= The base folder for the server log
(./log/server)
#   parseExpression = A RegularExpression to match.  Each group will
become a variable {%i},
# with i=1,2,... in the order shown in the
regex, with its value parsed
# from the message.  Currently
Station:ClientPC:TransactionID.  Only
# the station is being used, the other variables
in the expression 
# help prevent mismatches.
#   filespecFormat  = Format to use for the path and file name.  
#   {%T}= Timestamp is required somewhere IN the file
name.
#   {%d}= Current Day.  Optional.  May be in path, file
name, or nowhere.
#   {%s}= Server Name.  Optional.  Where this appender
is running.
# May be in path, file name, or nowhere.
#   {%i}= Where i is a variable number from the
parseExpression.  Optional.
# May be in path, file name, or nowhere.
#   defaultFilespec = Format to use for the path and file name when
parsing fails to find a match.
# For example, when there is no Station.
# It MUST include {%T} IN the file name.  It may
not have any {%i} values.
# {%d} and {%s} are allowed as in
filespecFormat.
#   maxDesiredSize  = Maximum size desired for individual log files.
I.e.: 1GB, 2MB or 4KB.
# It may be ignored based on minElapsedMinutes.
#   minElapsedMinutes   = A minimum time that must pass before rolling,
even if the maxDesiredSize has
# been reached.  This will prevent excessive
rolling when volume/hr is high.
# To ignore it, set it to a low value (i.e.: 1).
The default limits rolls to
# at most once an hour, or less, depending on
the maxDesiredSize.
#   forceRollTime   = A roll is forced on all open files at the time
specified.
#   zipAfterDays= Zip all files that are older than this number
of days.
#   disposeAfterDays= Delete all files that are older than this
number of days.
#
# RELEVANT FEATURES:
#   - There will be a roll of all open files at 00:00:00 every day, and
possibly one when a file
# is being opened for the first time in the day if it had not
previously rolled.
#   - zipping and deleting of old files happens during the daily roll.
#   - Logs are created as .txt files.  After zipping they are converted
to .zip.
# LIMITATIONS (intentional):
#   Currently using lazy algorithms that have higher performance but may
not trigger a roll until
#   later than normally expected:  
# - Elapsed time is being measured since start or last roll.
# - Only open files are rolled.
log4j.appender.LOGFILE=com...logging.DynamicTimestampedFileAppender
log4j.appender.LOGFILE.layout=com...logging.PCIPatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{-MM-dd
HH:mm:ss,SSS} [%t] [%c] %-5p - %m%n
log4j.appender.LOGFILE.basePath=${serverLog}
log4j.appender.LOGFILE.parseExpression=^(\\w{3}):([\\w\\-]{1,}):([\\d_]{
1,})
log4j.appender.LOGFILE.filespecFormat={%d}/server_{%1}_{%T}.{%s}
log4j.appender.LOGFILE.defaultFilespec={%d}/default.{%T}.{%s}
log4j.appender.LOGFILE.maxDesiredSize=2MB
log4j.appender.LOGFILE.minElapsedMinutes=60
log4j.appender.LOGFILE.forceRollTime=03:00
log4j.appender.LOGFILE.zipAfterDays=1
log4j.appender.LOGFILE.disposeAfterDays=6

Note: My appender does not limit the number of concurrent open files.
May I ask what is the limit in Unix/Linux if anyone knows?

bruno

RE: Passing log-time values to the Appender

2008-08-15 Thread Bruno Melloni
This looks very promising, whether I use it as is or as the basis to
customize my appender further.  Thank you.  

I am still not clear as to how to submit the variables in the
application (about the time I call Logger.info()) so that they arrive at
the Appender's subAppend() method inside the LoggingEvent.  Could you
clarify?  I hope it is not a dumb question.

bruno

-Original Message-
From: Curt Arnold [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2008 3:39 PM
To: Log4J Users List
Subject: Re: Passing log-time values to the Appender


On Aug 15, 2008, at 3:19 PM, Bruno Melloni wrote:

> I have an app that makes all Logger calls happen from a single class 
> and it uses a custom appender.  I need to modify the appender so that 
> it splits the logging to separate logs for each city.  The city code 
> is available in the calling class and is also being prefixed as the 
> first 3 characters of every message.
>
> I know I could create an appender for each city... but that would be 
> insane since there are too many cities.
>
> I suspect that the cleanest way would be to 'somehow' pass the city as

> a parameter when calling logger.info() and 'somehow' customize the 
> appender so that it can read the value and select which file to add it

> to.  Is this possible with log4j?  If so, how?
>
> Or, is there a better way to separate the logs?
>
> Thanks,
>
> bruno


There has been intermittent activity on a MultiFileAppender which
supports multiple open files by one appender.  It is not released and  
is subject to substantial change, but you may want to look at it.
See https://issues.apache.org/bugzilla/show_bug.cgi?id=45165 and search
the mailing list archives for MultiFileAppender.  The source is
available in the SVN at
http://svn.apache.org/repos/asf/logging/sandbox/log4j/multifile
.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Passing log-time values to the Appender

2008-08-15 Thread Bruno Melloni
I have an app that makes all Logger calls happen from a single class and
it uses a custom appender.  I need to modify the appender so that it
splits the logging to separate logs for each city.  The city code is
available in the calling class and is also being prefixed as the first 3
characters of every message.
 
I know I could create an appender for each city... but that would be
insane since there are too many cities.
 
I suspect that the cleanest way would be to 'somehow' pass the city as a
parameter when calling logger.info() and 'somehow' customize the
appender so that it can read the value and select which file to add it
to.  Is this possible with log4j?  If so, how?
 
Or, is there a better way to separate the logs?
 
Thanks,
 
bruno


Re: R: Multiple log4j.properties

2005-08-29 Thread Bruno Melloni
As I mentioned in my previous reply... it depends on the version of Tomcat.  If 
you are having this problem, solutions exist.  Here are a couple of ideas to 
explore, one of them might help you:

a) You might want to name the properties differently for each application (for 
example: app1Log4j.properties).  We started doing it a long time ago and I 
cannot remember the reason, but there was one.

b) You can also put "silencing rules" in your properties files (i.e.: severity 
= ERROR, or FATAL)... so that even if you have "leaking" between the server and 
the apps each log file will exclude the other's noise.

bruno

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 08/29 1:29 AM >>>
So if i have a log4j.jar in any webapp i can say that their log4j.properties 
are completely independent?

And i shouldn't mind if someone puts a log4j.rootLogger=DEBUG,stdout somewhere 
in any log4j.properties?

I don't know but it seems to me the opposite, i mean few months ago we deployed 
a web app which was bought from another software house; they used log4j 
configuring it as above (root logger at DEBUG level...), the result was an 
impressing amount of logging statements...and they did have a log4j.jar under 
their lib...

FS

-Messaggio originale-
Da: Jacob Kjome [mailto:[EMAIL PROTECTED] 
Inviato: venerdì 26 agosto 2005 16.29
A: Log4J Users List
Oggetto: Re: Multiple log4j.properties

Quoting Fabrizio Squittieri <[EMAIL PROTECTED]>:

> Hi,
> i've got a simple question.
> We have a Tomcat 5.0.5 on A linux server which runs a number of web 
> apps.
>
> Now we wanted to configure log4j in a single file and we did it by 
> adding a
>   -Dlog4j.configuration=file:/usr1/config_tmp/log/log4j.properties 
> \ row to catalina.sh .
>
> The question is: What does it happen if a web-app puts a 
> log4j.properties (e.g.log4j.rootLogger=DEBUG,stdout or some other bad 
> configs) in its WEB-INF/classes?
>
> Does it overwrite the global config?
>

No, it won't overwrite the global config as long as a copy of log4j.jar is 
included in the webapp.  It will use its own configuration and be completely 
separated from the global logger repository.  This is because of Tomcat's 
default parent-last classloading behavior (recommended by the servlet spec). 
If you had parent-first classloading behavior, which is usually the default in 
most larger application servers, then you would have a problem.


Jake

> Thanks
>
> Fabrizio Squittieri - Programmatore
>
> Sistema informativo - Comune di Prato
> Via Cairoli 16 - Prato
> 0574615275
>
> [EMAIL PROTECTED] 
> [EMAIL PROTECTED] 
>
>
>
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multiple log4j.properties

2005-08-29 Thread Bruno Melloni
A  word of caution.  I am not sure that every version of Tomcat behaves
that well.  JBoss (based on Tomcat for the web serving portion) had
problems with the isolation issue in several of its older versions
(roughly around the time of Tomcat 5.0) and claimed that its problems
were inherited from Tomcat.  As far as I know, this kind of problems do
not exist in Tomcat 5.5.

So, I would suggest testing to make sure you get no surprises.  
Forza Azzurri!!!

bruno

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 08/26 9:29 AM >>>
Quoting Fabrizio Squittieri <[EMAIL PROTECTED]>:

> Hi,
> i've got a simple question.
> We have a Tomcat 5.0.5 on A linux server which runs a number of web
> apps.
>
> Now we wanted to configure log4j in a single file and we did it by
> adding a
>  
-Dlog4j.configuration=file:/usr1/config_tmp/log/log4j.properties \
> row to catalina.sh .
>
> The question is: What does it happen if a web-app puts a
> log4j.properties
> (e.g.log4j.rootLogger=DEBUG,stdout or some other bad configs)
> in its WEB-INF/classes?
>
> Does it overwrite the global config?
>

No, it won't overwrite the global config as long as a copy of log4j.jar
is
included in the webapp.  It will use its own configuration and be
completely
separated from the global logger repository.  This is because of
Tomcat's
default parent-last classloading behavior (recommended by the servlet
spec). 
If you had parent-first classloading behavior, which is usually the
default in
most larger application servers, then you would have a problem.


Jake

> Thanks
>
> Fabrizio Squittieri - Programmatore
>
> Sistema informativo - Comune di Prato
> Via Cairoli 16 - Prato
> 0574615275
>
> [EMAIL PROTECTED] 
> [EMAIL PROTECTED] 
>
>
>
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Deprecated - what to use instead?

2005-08-19 Thread Bruno Melloni
My apologies, you are correct.  It says: "Deprecated: Replaced by
RootLogger" near the top of the page.  I missed it.  

It might be a good idea to make deprecated notices.  Now that I've seen
it I know what to look for, but perhaps making it large or even red
might be a good idea.  It would be easier for newcomers.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 08/19 10:56 AM >>>

On Aug 19, 2005, at 10:50 AM, Bruno Melloni wrote:

> One question and one suggestion for the log4j developers:
>
> Suggestion:
>
> When deprecating a class, please mention in the javadocs what the
> replacement code is.  Not everyone is a guru at all aspects of
log4j,
> and some hints and examples would go a long way when we try to
upgrade
> legacy code to the latest version.
>
> Question:
>
> org.apache.log4j.spi.RootCategory is now deprecated.  What should I 

> use
> instead?  My exact call is: "Hierarchy hierarchy = new Hierarchy(new
> RootCategory(Level.DEBUG));)"
>

RootLogger.  In the Javadoc @deprecation comment for the RootCategory 

class, there is a mention to use RootLogger instead.  However, I  
haven't checked the Javadoc to see how that was rendered.


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Deprecated - what to use instead?

2005-08-19 Thread Bruno Melloni
One question and one suggestion for the log4j developers:

Suggestion:

When deprecating a class, please mention in the javadocs what the
replacement code is.  Not everyone is a guru at all aspects of log4j,
and some hints and examples would go a long way when we try to upgrade
legacy code to the latest version.

Question:  

org.apache.log4j.spi.RootCategory is now deprecated.  What should I use
instead?  My exact call is: "Hierarchy hierarchy = new Hierarchy(new
RootCategory(Level.DEBUG));)"

Thanks.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Spam:Re: Reading config.xml from jarfile

2005-07-15 Thread Bruno Melloni
I have not experienced any problem with this approach for two reasons:

1) I always package my applications as EARs and run them in a J2EE 1.4
compliant container.  This makes all applications independent from each
other and the logging classes loaded into memory also independent from
one app to the next.   So each could take over the root logger and it
would not affect the container or other apps.  Note:  This was not
possible in jBoss prior to 4.0.2 due to some sort of Tomcat bug that
they inherited (check their release notes and forums for details).

2) By convention we always name log4j.xml and log files with the name
of the app.  For example, myappLog4j.xml and myapp.log.

My apologies for the late reply... I've been away from this thread for
almost 3 weeks.

Bruno Melloni

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 6/21/2005 4:38:55 PM >>>
Can't agree anymore on this.  I have seen a system in which we have
many different jars that have their own log4j.properties.  If you don't
put your own explicit log4j.properties in classpath or WEB-INF/classes,
expect to see weird logging layouts at strange places.  Cheers.

-Original Message-
From: Javier Gonzalez [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 21, 2005 5:24 PM
To: Log4J Users List
Subject: Spam:Re: Reading config.xml from jarfile


On 6/21/05, Bruno Melloni <[EMAIL PROTECTED]> wrote:
> But I'd like to suggest that you don't "just" put the XML config
file
> in the webapp.  You really want to do both.  A few days ago someone
> mentioned the name of an environment variable that if passed at app
> server startup (with -D... option) it would say where to pick up the
> log4j file.

But you must be careful with this - sometimes, you get somebody else's
jar with a log4j.properties buried inside it, and it decides it wants
the root logger in DEBUG level, or your Layour isn't as nice as the
one defined in said log4j.properties file. Or, God forbid, you get a
jar that gets into its head the idea of setting the
log4j.configuration property to its own secret log4j file. Now, you
get your tomcat running, and it logs fine. Reload your context and all
your logger configurations are gone.

If your logs start disappearing or formatting wrong after a context
reload, check your jars for a rogue log4j.properties, or the
log4j.configuration system variable. Might save you the time I lost
finding it out :)

-- 
Javier Gonzalez Nicolini

-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reading config.xml from jarfile

2005-06-21 Thread Bruno Melloni
I am sure someone else can explain the "how" much better than me.  These
things have been posted in this board several times.

But I'd like to suggest that you don't "just" put the XML config file
in the webapp.  You really want to do both.  A few days ago someone
mentioned the name of an environment variable that if passed at app
server startup (with -D... option) it would say where to pick up the
log4j file.  

So... if it is not defined:  Your app gets the config file from the WAR
or EAR.  If it is defined:  Your app gets it from the path specified. 
The beauty of this is (a) easy deployment and protection of the config
file, but also (b) ability to tweak the DEBUG/INFO/... level for the
various pieces during development.

I have been using this approach for over a year and I love it.  My logs
usually logs NOTHING (at INFO level) unless there is an error.  During
development I turn on DEBUG just for the classes that I am working with,
so that I am not overwhelmed by noise.  It's great.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 6/20/2005 7:44:55 PM >>>
Hi,

Is there somebody out there which can provide an example of how I can 
load a XML config file from a jar?
The idea is to add i.e. appl.xml to a jar and call 
DOMConfigurator.configure("appl.xml") within the application.

I would like to hide part of the configuration from the end-users to 
avoid that they make changes to parts of the configuration.

Other ideas are welcome as well.
Another path I walked was to do the 'hidden' part within the code, but
I 
could find a way to add the rendering info into th repository. So,
ideas 
or hints on how to do that are welcome as well.

Thanks

-- Eric.


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using with Struts

2005-06-20 Thread Bruno Melloni
You might want to check the version of Tomcat.  This issue sounds
terribly similar to the one that was in jBoss 4.x before 4.02.  If I
remember correctly the cause was inherited from the version of Tomcat
that jBoss was using.  At one point the logs were getting jumbled
together into the webapp log file (even the server logs).  You might
want to investigate how they solved that problem... you probably need
the same solution.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 6/13/2005 9:01:07 AM >>>
Quoting Anand Vijay <[EMAIL PROTECTED]>:

> Hi
>
> but it logs system wide but not the application
>

You said you are using Tomcat, right?  And do you have struts in
WEB-INF/lib
along with log4j.jar and commons-logging.jar?  You should also have
your config
file in WEB-INF/classes.  There is no reason I can think of that this
wouldn't
provide per-webapp logging.  In fact, it is quite simply impossible for
2
webapps to see each other if your libraries are all stored in
WEB-INF/lib.  I
suggest re-visiting your webapp structure to verify that you have
things set up
properly.

Jake

> - Original Message -
> From: "Jacob Kjome" <[EMAIL PROTECTED]>
> To: "Log4J Users List" ; "Anand
Vijay"
> <[EMAIL PROTECTED]>
> Sent: Monday, June 13, 2005 7:20 PM
> Subject: Re: Using with Struts
>
>
> >
> > So put log4j.jar and commons-logging.jar in your WEB-INF/lib.  Are
you
> having
> > problems with this setup?  It should work fine.
> >
> > Jake
> >
> > Quoting Anand Vijay <[EMAIL PROTECTED]>:
> >
> > > Hi All
> > >
> > > How to use log4j with tomcat 4.x and struts? . I would like to
log only
> one
> > > of the webapps..
> > >
> > > Regards
> > > Vijay
> >
> >
> >
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: log4J and JBoss

2005-06-06 Thread Bruno Melloni
I do use this setting as part of the settings to obtain J2EE 1.4
compatibility and get pretty decent isolation between the stuff in your
EAR and the jBoss logging.  

I think the full configuration is described in either 4.01 or 4.02
release notes, even though the docs do have an error and I don't
remember the exact one - just be sure to compare the config files
mentioned with the config files from version 4.0.0.  A nuisance, but it
is the only way to get the real setup.

But no.  The change I was talking about was a change the jBoss guys did
to their code and that finally fixed the logging issues.  I think the
log4j problem was originally inherited from Tomcat (which is part of
jBoss).  And I am not sure, but it is quite possible that you have to
configure for J2EE 1.4 compatibility (as I mentioned above I am already
doing that).  It is also possible that you have to use an EAR file
instead of just a WAR.

I know I am not giving you many answers... but I hope this gets you
investingating in the right direction.  I can just say that "for the
configuration I am using (EAR, full J2EE 1.4 compatibility)" the
log4j/jBoss problem is fixed... and a new similar one regarding
Hibernate showed up :P

Good luck.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 6/6/2005 12:33:50 PM >>>
Bruno,

Is this the change you are talking about in JBoss 4.0.2?

http://jira.jboss.com/jira/browse/JBAS-1691 

Looks like they decided to default to child-first classloading with
options
to allow for parent-first delegation for specified packages.

-Mark

> -Original Message-
> From: Bruno Melloni [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 03, 2005 5:19 AM
> To: log4j-user@logging.apache.org 
> Subject: Re: log4J and JBoss
> 
> Depends on the version of jBoss that you use.  Try jBoss 4.02.  If
it
> doesn't break any of your other technologies (it is incompatible
with
> some things), then you are in business... because they fixed their
> logging problems in 4.02.
> 
> Bruno Melloni
> Director of Software Architecture
> Akuratus Corporation
> 1333 N. Stemmons Fwy, Suite 110
> Dallas, Texas 75207
> Phone: 469.227.0920
> Fax: 469.227.0967
> [EMAIL PROTECTED] 
> www.akuratus.com 
> 
> >>> [EMAIL PROTECTED] 6/3/2005 2:43:01 AM >>>
> Hi,
> 
> Is it possible to use log4j  within my code independently of JBoss
> logging? Apparently when I run JBoss I stop receiving my own logs.
> 
> environment:  JBoss 3.2, Eclipse 3.0, jdk 1.4, log4j 1.2.9, ant and
> xdoclet 1.2.1
> 
> thanks!
> 
> Fabien
> 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4J and JBoss

2005-06-03 Thread Bruno Melloni
Depends on the version of jBoss that you use.  Try jBoss 4.02.  If it
doesn't break any of your other technologies (it is incompatible with
some things), then you are in business... because they fixed their
logging problems in 4.02.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 6/3/2005 2:43:01 AM >>>
Hi,

Is it possible to use log4j  within my code independently of JBoss 
logging? Apparently when I run JBoss I stop receiving my own logs.

environment:  JBoss 3.2, Eclipse 3.0, jdk 1.4, log4j 1.2.9, ant and 
xdoclet 1.2.1

thanks!

Fabien


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Log4j logging under Tomcat5 (was Re: Multiple Projects Using Same Logger)

2005-05-27 Thread Bruno Melloni
FYI, I have seen this behavior in one of the 4.0x versions of jBoss too
(probably because it uses Tomcat).  In any case, by 4.0.2 they had fixed
it, so there might be a correction for Tomcat itself too.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 5/23/2005 1:19:11 AM >>>
Hi Jacob, yes, I did think it odd that a web server/servlet container 
(Tomcat) should pick up a properties file in one of its web apps!  I
now 
think the more sane explanation is that I was hasty in my offhand
reporting, 
and that the "ton" of output I saw was from JSF, not Tomcat.  That
would 
make a little more sense, because all JSF jars are in WEB-INF/lib of
the 
webapp.  And, again, as mentioned, JSF was in the mix when I noticed
the 
same kind of copious output under Sun Web Server.

I should set root logger to DEBUG and look more closely at the output.

Regards,

--A

>Log4j uses the thread context classloader to locate/load the property
file, 
>but the thread wouldn't have been started from the webapp, so I don't
see 
>how that would come into play here?  Do you, somehow, have
WEB-INF/classes 
>of your webapp in the system classpath or something?  But if you use
the 
>startup scripts, Tomcat eschews the system classpath.  Hm  In
any 
>case, this is very odd.

_
Express yourself instantly with MSN Messenger! Download today - it's
FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: log4j stops logging at console

2005-05-18 Thread Bruno Melloni
This problem was fixed in (I believe) jBoss 4.0.2.   Of course in that
same versions they screwed up other stuff... (i.e.: Hibernate would no
longer work if you had it in your application) so you may or may not
want to use that version anyway.  But they are aware of the issues and I
hope they will eventually fix all these problems.

Good luck.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 5/16/2005 11:38:55 AM >>>
JBoss, by current design, only provides for one logging context (ie
LoggerRepository).  On top of that, the JBoss log4j.xml also sets up a
special CONSOLE appender that maps the System.out and System.err
streams.

If you do any kind of configuration after JBoss starts up that affects
the
console appender OR affects loggers that have been defined in the
JBoss
log4j.xml file, then it will affect the output to the log files. 
Especially
Console, do not mess with Console.  Also, if your log4j code ever
calls
LoggerRepository.shutdown() during a redeploy, then logging will be
hosed as
well.

JBoss really needs to provide a better mechanism to allowing web apps
and
ejb's to do their own logging.

Log4j does provide some "layering" of configuration where you can set
up
your own loggers and appenders as long as they are not references by
the
first/base configuration file.  Or you can just add your logging stuff
to
the JBoss log4j.xml file directly.

You may also find the following link useful, but I don't know if anyone
has
gotten to work correctly in JBoss or not.  Seems to me that to be
completely
efficient, it would need to be supported pretty deep in the JBoss
log4j
initialization.

http://www.qos.ch/logging/sc.jsp 

-Mark


> -Original Message-
> From: Clandes Tino [mailto:[EMAIL PROTECTED] 
> Sent: Monday, May 16, 2005 6:51 AM
> To: log4j-user@logging.apache.org 
> Subject: log4j stops logging at console
> 
> Hello all.
> I am facing the problem with log4j usage in two
> separate applications.
> I am using CONSOLE appenders for both of them.
> Applications are started separately (in two shell
> windows). The first app (App1) is assembled as EAR and
> deployed under JBoss (it uses log4j.jar from
> JBoss/server/default/lib and initializes log4j through
> MBean, where appenders and loggers are configured).
> 
> Here is the method in MBean that configures log4j in
> App1:
> ---
> private void initLog4j() throws ConfigurationException
> {
> final Properties props = new Properties();
> props.setProperty("log4j.category.com.myapp",
> "DEBUG, CONSOLE, FILE");
> 
>
props.setProperty("log4j.appender.CONSOLE","org.apache.log4j.ConsoleAppend
> er");
>
props.setProperty("log4j.appender.CONSOLE.layout","org.apache.log4j.Patter
> nLayout")
> 
>
props.setProperty("log4j.appender.CONSOLE.layout.ConversionPattern","%d{IS
> O8601}
>  %-5p [%c{1}] [%X{user}]  - %m%n");
> 
>
props.setProperty("log4j.appender.FILE","org.apache.log4j.RollingFileAppen
> der");
> 
> props.setProperty("log4j.appender.FILE.File",
> getConfigurationSetting(LOG_FILE));
> 
> props.setProperty("log4j.appender.FILE.MaxFileSize",
> getConfigurationSetting(MAX_FILE_SIZE));
> 
> props.setProperty("log4j.appender.FILE.MaxBackupIndex",
> getConfigurationSetting(MAX_BACKUP_FILE));
> 
>
props.setProperty("log4j.appender.FILE.layout","org.apache.log4j.PatternLa
> yout");
> 
>
props.setProperty("log4j.appender.FILE.layout.ConversionPattern","%d{ISO86
> 01}
>  %-5p [%c{1}] [%X{user} %X{ip} %X{userAgent}] -
> %m%n");
> 
> PropertyConfigurator.configure(props);
>  }
> 
> App1 uses A.jar and B.jar from App2 in compilation and
> runtime. Both jars are placed in sar archive and
> deployed in default/deploy folder under Jboss.
> 
> The other (App2) is RMI Server application deployed
> separately (it uses another log4j-1.2.8.jar placed in
> its classpath). A.jar and B.jar are in its classpath.
> App2 configures log4j by log4j properties file:
> 
> 
> log4j.category.CONSOLE = , aCONSOLE
> log4j.appender.aCONSOLE =
> org.apache.log4j.ConsoleAppender
> log4j.additivity.CONSOLE=false
> log4j.appender.aCONSOLE.ImmediateFlush=true
> log4j.appender.aCONSOLE.layout=org.apache.log4j.PatternLayout
> --
> 
> Both applications are physically on the same machine.
> The problem occurs when some clas

Re: log4j 1.3 update needed...

2005-05-09 Thread Bruno Melloni
Hein,

I am not a log4j developer, just a log4j user.  But I understand
development quite well.  We would all like easy to build, friendly CVS,
alpha and beta vesions, but those are not part of the product.  Alpha
versions of any software are expected to be a mess... the whole purpose
of their existence is to help the developers, not us users.  Beta
versions are for final debugging.  You should not be using those
versions for normal work.  

I suggest that you do what I do... don't use Alpha versions, and avoid
Beta versions as much as possible.

Good luck.

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

>>> [EMAIL PROTECTED] 5/8/2005 4:11:38 PM >>>
Dear log4j developers.

I would really like to encourage you to release a new 1.3 alpha7 or
beta1 something ASAP, as alpha6 has been out there for too long
without
any updates; and I don't want to spend my time trying to compile a cvs
version, since it does not appear to be straight forward with maven or
some other simple means (that is, I don't want to hunt the net for jar
files...)

In particular, I find alpha6 quite useless with all its log4j internal
log output polluting the output, similar to this:

log4j:INFO Creating new logger [jgroup.util.log.Eventlogger] in
repository [default].

Maybe its possible to turn them off; (have only seen messages on the
list stating otherwise)...

Thanks,

Hein



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Small email on error or above

2005-04-29 Thread Bruno Melloni
This need is probably very simple, well known and solved a long time
ago:

I'd like to send a tiny ": Error DD/MM/YY HH:MM:SS" to an
email address (or list of addresses) read from a configuration file
(could even be in log4j.xml).  I only want to send it when the severity
is Error or higher.  I don't want to send the full error message, just a
short string so that the email can be routed through SMS to the support
administrators cell phone messaging.

I know I could extend Logger and use the new class instead of Logger. 
But I suspect someone has already solved this, maybe through an
appender.  

So here comes the obvious question: what is the best approach to solve
this need?

Thanks

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
[EMAIL PROTECTED]
www.akuratus.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]