SMTPAppender configuration

2002-07-22 Thread jerome gloaguen

I use a confi file,
when I create a TriggeringEventEvaluator, needded by
the SMTPAppender, I don't know how to configure the
trigger value (number of messages to log in the
email).
Please help me..

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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




how to specify non-standard Priority level in property files?

2002-07-22 Thread Blümer, Jürgen (empolis GT)

hi,

the setting of the level by using a property file doesn't work.

in the property file I've inserted the following line:

log4j.rootLogger=SQL#classpath.PDMSLevel, A1

the class PDMSLevel extends Level. the java code just uses the statement:

PropertyConfigurator.configure(properties);

the log output follows now:

log4j: Trying to find [log4j.properties] using context classloader
sun.misc.Launcher$AppClassLoader@71732b.
log4j: Trying to find [log4j.properties] using
sun.misc.Launcher$ExtClassLoader@7fdcde class loader.
log4j: Trying to find [log4j.properties] using
ClassLoader.getSystemResource().
log4j: Could not find resource: [log4j.properties].
log4j: Parsing for [root] with value=[SQL#classpath.PDMSLevel, A1].
log4j: Level token is [SQL##classpath.PDMSLevel].
log4j: toLevel:class=[#classpath]:pri=[SQL]
log4j: Category root set to DEBUG
log4j: Parsing appender named A1.
log4j: Parsing layout options for A1.
log4j: Setting property [conversionPattern] to [%-4r [%t] %-5p %c %x -
%m%n].
log4j: End of parsing for A1.
log4j: Parsed A1 options.
log4j: Finished configuring.

it looks, as if my settings have not been used! the level of the logger
seems to remain 'DEBUG'.

Neither
logger.log((Level) PDMSLevel.FATAL, SQL Test!);
nor
if(logger.isEnabledFor((Level) PDMSLevel.FATAL)){
work in the way I've expected. Any time the output is written to the
console.

when using

logger.setLevel((Level) PDMSLevel.SQL);

the level of the current logger is correct.

How can I solve this problem?


---
Maenner brauchen Musik, Sonnenallee, Leander Haussmann (1999)

Juergen Bluemer
empolis GmbH
An der Autobahn 2
33311 Guetersloh
Germany

Phone +49 (0) 5241 80 88739

[EMAIL PROTECTED]


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




Article on JMS logging

2002-07-22 Thread Ceki Gülcü


Curiously enough, while preparing the JMSAppender section in my book
the complete log4j manual, I came across the following article
entitled Develop an Asynchronous Logging Framework using log4j with
JMS and WebSphere MQ. Here is the link:

http://www7b.software.ibm.com/wsdd/library/techarticles/0207_barcia/barcia.html


It touches on the problem of caching connections/sessions and proposes
a solution.  The way com.ibm.logdemo.message.LOGXMLMessage objects are
transformed is interesting as an anti-pattern. The
com.ibm.logdemo.appender.LogClass employs a classical log4j
anti-pattern by calling Category.getInstance() for each log operation.
I don't understand why the author did not just use XMLLayout. The
author writes:

   For this example, we will create a small custom XML type layout to
   demonstrate how log4j message formats may be customized. The intent
   here is not to show XML best practices, just log4j functionality.

But I still don't get it. In any case, it is certainly worthwhile
reading for those interested in JMS logging.


--
Ceki


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




Re: Article on JMS logging

2002-07-22 Thread Roland Barcia


Ceki,

Thank You for you feedback and suggestions.

There are plenty of ways to design out the log4j classes.  A full design
and analysis would probably not fit into article of this nature.  I would
definitely put more design in each aspect of a logging architecture.  I
wanted to point out the benefit of logging with JMS, how to implement it
with the tools, and showing how the technologies integrate.


Roland Barcia
IBM Software Services for Websphere
[EMAIL PROTECTED]
201-869-9630cell-201-519-8010


Ceki Gülcü [EMAIL PROTECTED] on 07/22/2002 07:25:20 AM

To:[EMAIL PROTECTED]
cc:Roland Barcia/Paramus/IBM@IBMUS
Subject:Article on JMS logging




Curiously enough, while preparing the JMSAppender section in my book
the complete log4j manual, I came across the following article
entitled Develop an Asynchronous Logging Framework using log4j with
JMS and WebSphere MQ. Here is the link:

http://www7b.software.ibm.com/wsdd/library/techarticles/0207_barcia/barcia.html



It touches on the problem of caching connections/sessions and proposes
a solution.  The way com.ibm.logdemo.message.LOGXMLMessage objects are
transformed is interesting as an anti-pattern. The
com.ibm.logdemo.appender.LogClass employs a classical log4j
anti-pattern by calling Category.getInstance() for each log operation.
I don't understand why the author did not just use XMLLayout. The
author writes:

   For this example, we will create a small custom XML type layout to
   demonstrate how log4j message formats may be customized. The intent
   here is not to show XML best practices, just log4j functionality.

But I still don't get it. In any case, it is certainly worthwhile
reading for those interested in JMS logging.


--
Ceki






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




looping console appender

2002-07-22 Thread Nathaniel G. Auvil


hi all.

If i use the following lines of code under log4j 1.2.2

Logger.getRootLogger().removeAllAppenders();
Logger.getRootLogger().addAppender( new ConsoleAppender( new PatternLayout( 
%12.12d{ABSOLUTE}
[%3.3t] [%c{1}] %m%n ) ) );

i get the following error message and jboss dies.

ERROR: invalid console appender config detected, console stream is looping


I even tried: 
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure( new ConsoleAppender( new PatternLayout( 
%12.12d{ABSOLUTE} [%3.3t]
[%c{1}] %m%n ) ) );

and got the same thing.

What am i doing wrong?





__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




RE: how to append to different output files on the fly

2002-07-22 Thread Bill Milbratz

Download the log4j at 
http://jakarta.apache.org/log4j/jakarta-log4j-1.2.3/docs/download.html
and follow Raghu's instructions 

Two things:
1) The above link doesn't work for 1.2.3. I have 1.2.5. Does your above
comment hold true for 1.2.5?
2) I searched the 1.2.5 docs and src for [Rr]aghu and didn't find
anything. Could you clarify where to find Raghu's instructions?


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




The supposedly resolved JUnit vs log4j appender problem

2002-07-22 Thread Gareth Cronin

Hi,

Looking at the list archives, this issue has cropped up before, but there
are references to it having been fixed as of log4j 1.2.5. I am using JUnit
3.7, and when I attempt to initialise a Logger, I get the following error:

log4j:ERROR A org.apache.log4j.ConsoleAppender object is not assignable to
a org.apache.log4j.Appender variable.
log4j:ERROR Could not instantiate appender named A1.

There are no rogue log4j.properties files in my class path, nor are there
any rogue older versions of log4j. This problem does not occur when I run
the program independently, but it does occur under any JUnit test.

I was previously using JUnit 3.7 with log4j-1.1.x and the old Category class
- the problem was not occuring in that configuration.

TIA,

Gareth.

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




RE: Logging to separate files

2002-07-22 Thread Havaldar, Raghu

There are multiple solutions, a simpler one of which is below:

- create 2 loggers, each hooked with a FileAppender. 
- have your component log to those separate loggers.

example config:

log4j.rootLogger=DEBUG,

log4j.logger.logger1=INFO,fileAppender1
log4j.logger.logger2=INFO,fileAppender2

log4j.appender.fileAppender1=org.apache.log4j.FileAppender
log4j.appender.fileAppender1.File=file1.log

log4j.appender.fileAppender2=org.apache.log4j.FileAppender
log4j.appender.fileAppender2.File=file2.log

-raghu


-Original Message-
From: Daly, Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 19, 2002 4:55 PM
To: '[EMAIL PROTECTED]'
Subject: Logging to separate files


I have two separate components running as part of a single app. Is there a
way to have each component log to it's own log file? I have not been able to
find an example of this in the docs but I think I saw it eluded to.

If I have two separate apps running in the same JVM, how do I configure
their logging configuration separately?

Michael S. Daly
MerckVaccines.com(TM)
Merck  Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]




--
Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (Whitehouse Station, New Jersey, USA) that
may be confidential, proprietary copyrighted and/or legally privileged, and
is intended solely for the use of the individual or entity named in this
message.  If you are not the intended recipient, and have received this
message in error, please immediately return this by e-mail and then delete
it.


==


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

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




RE: Logging to separate files

2002-07-22 Thread Daly, Michael

How do I instruct each component to write to the correct logfile?

Michael S. Daly
MerckVaccines.com(TM)
Merck  Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]


-Original Message-
From: Havaldar, Raghu [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 4:29 PM
To: 'Log4J Users List'
Subject: RE: Logging to separate files


There are multiple solutions, a simpler one of which is below:

- create 2 loggers, each hooked with a FileAppender. 
- have your component log to those separate loggers.

example config:

log4j.rootLogger=DEBUG,

log4j.logger.logger1=INFO,fileAppender1
log4j.logger.logger2=INFO,fileAppender2

log4j.appender.fileAppender1=org.apache.log4j.FileAppender
log4j.appender.fileAppender1.File=file1.log

log4j.appender.fileAppender2=org.apache.log4j.FileAppender
log4j.appender.fileAppender2.File=file2.log

-raghu


-Original Message-
From: Daly, Michael [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 19, 2002 4:55 PM
To: '[EMAIL PROTECTED]'
Subject: Logging to separate files


I have two separate components running as part of a single app. Is there a
way to have each component log to it's own log file? I have not been able to
find an example of this in the docs but I think I saw it eluded to.

If I have two separate apps running in the same JVM, how do I configure
their logging configuration separately?

Michael S. Daly
MerckVaccines.com(TM)
Merck  Co., Inc.
MVD IS
Mail:   WP97-A369
Phone:  215-652-4735
Pager:  1-888-621-5636
Fax:215-652-8846
E-mail: [EMAIL PROTECTED]




--
Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (Whitehouse Station, New Jersey, USA) that
may be confidential, proprietary copyrighted and/or legally privileged, and
is intended solely for the use of the individual or entity named in this
message.  If you are not the intended recipient, and have received this
message in error, please immediately return this by e-mail and then delete
it.


==


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

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



--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck  Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, 
proprietary copyrighted and/or legally privileged, and is intended solely for the use 
of the individual or entity named in this message.  If you are not the intended 
recipient, and have received this message in error, please immediately return this by 
e-mail and then delete it.

==


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




Re: The supposedly resolved JUnit vs log4j appender problem

2002-07-22 Thread Ceki Gülcü


Gareth,

You most probably have two copies of log4j lying around.

At 08:26 23.07.2002 +1200, Gareth Cronin wrote:
Hi,

Looking at the list archives, this issue has cropped up before, but there
are references to it having been fixed as of log4j 1.2.5. I am using JUnit
3.7, and when I attempt to initialise a Logger, I get the following error:

log4j:ERROR A org.apache.log4j.ConsoleAppender object is not assignable to
a org.apache.log4j.Appender variable.
log4j:ERROR Could not instantiate appender named A1.

There are no rogue log4j.properties files in my class path, nor are there
any rogue older versions of log4j. This problem does not occur when I run
the program independently, but it does occur under any JUnit test.

I was previously using JUnit 3.7 with log4j-1.1.x and the old Category class
- the problem was not occuring in that configuration.

TIA,

Gareth.

--
Ceki


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




RE: Logging to separate files

2002-07-22 Thread Colin MacDonald

 -Original Message-

 How do I instruct each component to write to the correct logfile?

 -Original Message-

 There are multiple solutions, a simpler one of which is below:

 - create 2 loggers, each hooked with a FileAppender.
 - have your component log to those separate loggers.

 example config:

 log4j.rootLogger=DEBUG,

 log4j.logger.logger1=INFO,fileAppender1
 log4j.logger.logger2=INFO,fileAppender2

If I'm reading this right, a more class-oriented version of these lines
could be:

log4j.logger.com.mycompany.myclass=INFO,fileAppender1
log4j.logger.com.mycompany.myotherclass=INFO,fileAppender2

And you probably want to set:

log4j.additivity.com.mycompany.myclass=false
log4j.additivity.com.mycompany.myotherclass=false

Or am I missing something here?  ;)

-
Colin MacDonald  |  Software Developer  |  Templar Corporation  |
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002


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