RE: Log4J in JSP Pages

2004-12-06 Thread Shapira, Yoav

Hi,
You mean like
<% Logger logger = Logger.getLogger(getClass().getName());
   logger.warn("oh no!");
%>

Or via tags and such, e.g.
http://jakarta.apache.org/taglibs/doc/log-doc/intro.html?

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Norma Spence [mailto:[EMAIL PROTECTED]
>Sent: Monday, December 06, 2004 2:29 PM
>To: Log4J Users List
>Subject: Log4J in JSP Pages
>
>Does anyone have any links to examples/tutorials of using Log4J in jsp
>pages?
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: level inheritance, kind of :)

2004-11-30 Thread Shapira, Yoav

Hi,
Yeah, I thought you didn't want A to log A.B's error messages...

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Oliver Epper [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 30, 2004 10:03 AM
>To: Log4J Users List; Patrick Kranz
>Subject: Re: level inheritance, kind of :)
>
>Hi,
>
>thx for the quick answer ! But doing that would prevent A from logging
>A.B's error messages,
>wouldn't it ?
>
>thx
>Oliver
>
>>Hi,
>>You probably want to set additivity=false on these, so that the all
>>doesn't trump the error and they're kept separate, each at its own
>>level.
>>
>>Yoav Shapira http://www.yoavshapira.com
>>
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: level inheritance, kind of :)

2004-11-30 Thread Shapira, Yoav

Hi,
You probably want to set additivity=false on these, so that the all
doesn't trump the error and they're kept separate, each at its own
level.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Oliver Epper [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 30, 2004 8:38 AM
>To: [EMAIL PROTECTED]
>Subject: level inheritance, kind of :)
>
>Hi all !
>
>I have some issues understanding how to use log4j. Please imagine the
>following:
>Two loggers, one called A, one called A.B.
>A has the appender AppA and A.B has the appender AppB.
>A's level is set to error and A.B's to all.
>What I need/want to achive is that A.B logs everything and A only error
>messages.
>The only way I could manage this is by settings AppA's threshold to
error.
>
>That's fine so far, but what is the sense of  setting A's level to
>error, then ?
>Even setting A's level to all doesn't give me more than error messages,
>then.
>
>would be nice, if someone could light this up for me
>Oliver
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Log4J API, for D

2004-11-29 Thread Shapira, Yoav

Hi,
Added to "Other Ports" section, updated site.  Thank you for notifying
us, and keep up this interesting work.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Kris Bell [mailto:[EMAIL PROTECTED]
>Sent: Sunday, November 28, 2004 8:23 PM
>To: [EMAIL PROTECTED]
>Subject: Log4J API, for D
>
>Hi,
>
>Thought I'd let you know that D (http://digitalmars.com/d/) has had
support
>for the Log4J API since May of this year. Wanted to ask if you'd
consider
>adding this to the list of "other ports"?
>
>The Mango Tree (http://www.dsource.org/forums/viewforum.php?f=5) has a
>Mango.log4D package which supports all the primary features of Log4J.
In
>addition, it includes an optional browser-based 'Administrator' for
>remotely
>inspecting and adjusting the log-settings within a running application.
>Also
>features (optional) multiple hierarchies; Chainsaw support; and a
number of
>other goodies. Very fast, with zero-impact on the runtime GC.



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: IMAP appender?

2004-11-29 Thread Shapira, Yoav

Hi,
Well, the error method invokes on the ErrorHandler implementation will
contain a message and possibly an exception which is the root cause.
You can introspect those as you see fit.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: None None [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 29, 2004 10:38 AM
>To: [EMAIL PROTECTED]
>Subject: RE: IMAP appender?
>
>Ok that fine bassically I just want to know at least if there is an
>exception caught like trying to open the connection to the SMTP server
in
>cases where SMTP host is misspelled or there might have been a network
drop
>etc...
>
>>From: "Shapira, Yoav" <[EMAIL PROTECTED]>
>>Reply-To: "Log4J Users List" <[EMAIL PROTECTED]>
>>To: "Log4J Users List" <[EMAIL PROTECTED]>
>>Subject: RE: IMAP appender?
>>Date: Mon, 29 Nov 2004 10:32:41 -0500
>>
>>
>>Hi,
>>
>> >Ok I know there is no way with SMMTP to guarantee that there was an
>>e-mail
>> >sent... But with this error handler I will be able at least to
detect
>> >whther
>> >at least the SMTP server was down?
>>
>>You would know that an SMTP error occurred.  You wouldn't know
>>specifically its cause, such as SMTP server down, or SMTP
authentication
>>failed.  You would log to a file (or other mechanism that's more
>>reliable than SMTP) the original exception as well as another message
>>saying you failed to send the SMTP message.
>>
>>Yoav
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary and/or privileged.  This e-mail is intended only for the
>>individual(s) to whom it is addressed, and may not be saved, copied,
>>printed, disclosed or used by anyone else.  If you are not the(an)
>intended
>>recipient, please immediately delete this e-mail from your computer
system
>>and notify the sender.  Thank you.
>>
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>_
>Powerful Parental Controls Let your child discover the best the
Internet
>has
>to offer.
>http://join.msn.com/?pgmarket=en-
>ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Mark
et_M
>SNIS_Taglines
>  Start enjoying all the benefits of MSN(r) Premium right now and get
the
>first two months FREE*.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: IMAP appender?

2004-11-29 Thread Shapira, Yoav

Hi,

>Ok I know there is no way with SMMTP to guarantee that there was an
e-mail
>sent... But with this error handler I will be able at least to detect
>whther
>at least the SMTP server was down?

You would know that an SMTP error occurred.  You wouldn't know
specifically its cause, such as SMTP server down, or SMTP authentication
failed.  You would log to a file (or other mechanism that's more
reliable than SMTP) the original exception as well as another message
saying you failed to send the SMTP message.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: IMAP appender?

2004-11-29 Thread Shapira, Yoav

Hi,
There's no IMAP appender built into the log4j core that I'm aware of.
You can write one ;)

You can define an ErrorHandler for an Appender.  It would be called if
the Appender fails.  See the org.apache.log4j.ErrorHandler JavaDoc for
more details.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: None None [mailto:[EMAIL PROTECTED]
>Sent: Friday, November 26, 2004 12:42 AM
>To: [EMAIL PROTECTED]
>Subject: IMAP appender?
>
>I need to gaurantee that my e-mail was sent to the mail server. It
seems as
>if SMTP appender does not dtect errors.
>
>So if my e-mail was not sent with the IMAP appender to fail over to
file
>and
>console or something like that!
>
>Is there an IMAP appender?
>
>Thanks
>
>_
>Powerful Parental Controls Let your child discover the best the
Internet
>has
>to offer.
>http://join.msn.com/?pgmarket=en-
>ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Mark
et_M
>SNIS_Taglines
>  Start enjoying all the benefits of MSN(r) Premium right now and get
the
>first two months FREE*.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: Unknown periodity - Is DailyRollingFileAppender broken in log4j 1.3 alpha ?

2004-11-23 Thread Shapira, Yoav

Hi,

>OK , I'll ask the big question ... When are we going to see the
>documentation which is currently lacking ?

>It is frustrating to code at the 1.3 level using the 1.2.8 (1.2.9)
>documentation.

You're using unreleased, alpha-level code.  It's frustrating when stable
code has no good documentation, but you should adjust your expectations
for unreleased code.

Another alternative is, as always, to step up to the plate and put your
money where you mouth is, writing some docs and contributing them ;)

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: getting 1.3 code...

2004-11-19 Thread Shapira, Yoav

Hi,
You need to it over a SSH connection: use PuTTY or a similar client as
instructed at http://www.apache.org/dev.  The CVS server is working
fine, I'm using it right now.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Alan Brown [mailto:[EMAIL PROTECTED]
>Sent: Friday, November 19, 2004 12:10 PM
>To: Log4J Users List
>Subject: getting 1.3 code...
>
>
>I can't seem to connect to cvs to get the latest code.
>
>From a windows shell, I'm using...
>
>set CVSROOT=:pserver:[EMAIL PROTECTED]:/home/cvspublic
>
>and
>
>
>cvs login
>
>I am asked for my password and I get...
>
>cvs [login aborted]: connect to cvs.apache.org:2401 failed: No
>connection could be made because the target machine actively refused
it.
>
>Am I missing something?  Is the cvs server down?
>
>
>Sorry for the basic question...
>
>alan
>
>
>
>===
>Notice: This e-mail message, together with any attachments, contains
>
>information of Symyx Technologies, Inc. that may be confidential,
>
>proprietary, copyrighted, privileged and/or protected work product,
>
>and is meant solely for the intended recipient. If you are not the
>
>intended recipient, and have received this message in error, please
>
>contact the sender immediately, permanently delete the original and
>
>any copies of this email and any attachments thereto.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: How to determine if log4j has been configured

2004-11-16 Thread Shapira, Yoav

Hi,

>Setting the override property would likely help when running
standalone,
>but we
>don't have a problem them. I don't think it will help when running
under
>JBoss
>because because then JBoss would not initialize log4j at all, right?

Wrong.  This would be useful in ruling out the default initialization,
and ruling in programmatic initialization, a significant debugging help.

>really don't know anything about how that works, I could be wrong. But
I

Read the Short Manual's section on the default initialization.  The
Short Manual is on the log4j web site.

>stepped
>through the app from the first statement, which is a call to the ctor
of an
>'agent'. Nothing really takes place other than initialization of a few
>instance
>attributes until the call to getRootLogger().

That's fairly meaningless, since many things happen before your app's
first statement is ever reached.  Static initializers and a ton of
container code runs first.

>I figure I really have 2 options at this point, and both of them will
be
>useful.
>I can download the source for log4j1.2.8 and step through what is
actually
>occurring. The knowledge gained from this should certainly be
worthwhile.
>And I
>can setup JBoss on this box, configure it to run the app that is
causing us
>problems, and step through that initialization process. That
examination
>*might*
>provide me with some clues as to what I can examine in order to
determine
>when we
>are running under JBoss.

Sure, both of those would be useful.

>Oh yeah, or I can just rely on using a ctor that takes an argument for
>setting a
>flag that specifies to *not* perform the special log4j configuration.
But I

You can go off the same system property log4j itself uses, it doesn't
have to be a special flag.

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: two log4j repository?

2004-11-16 Thread Shapira, Yoav

Hi,
Yes, search the list archives for more.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Zhu Qifei [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 16, 2004 2:14 AM
>To: Log4J Users List
>Subject: two log4j repository?
>
>Hi all,
>
>Can i have two separate log4j repository in one JVM? Thanks a lot!
>
>Regards
>Qifei
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: How to determine if log4j has been configured

2004-11-16 Thread Shapira, Yoav

Hi,
You can set the log4j.defaultInitOverride system property (to any value
other than false), and when so configured any log4j.properties or
log4j.xml files on the classpath will be ignored.

However, it might simply be something else doing programmatic
configuration before your code does it.  It's not necessarily the
default init process that's causing this.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 16, 2004 8:38 AM
>To: Log4J Users List
>Subject: RE: How to determine if log4j has been configured
>
>
>
>
>
>Thanks Paul,
>
>It definately appears that I am picking up a log4j config file from
>somewhere on
>the classpath. And it seems that the call to Logger.getRootLogger() is
>triggering
>log4j to get configured by reading it. So it seems that for me to get
this
>to
>work, my log4j config file must be named something other than
>log4j.properties,
>and I have to make sure that there are *no* other log4j config files
any
>where on
>my classpath.
>
>
>
>Dave
>
>We must begin not just to act, but to think, for there is no better
slave
>than the one who believes his slavery to be freedom, and we are in
>no greater peril than when we cannot see the chains on our minds
>because there are yet no chains on our feet.
>-- Michael Reid
>
>
>
>
>
>  "Paul Smith"
>  <[EMAIL PROTECTED] To:  "Log4J Users
List"
><[EMAIL PROTECTED]>
>  om>  cc:
>   Subject: RE: How to
>determine if log4j has been configured
>  11/15/2004 04:45
>  PM
>  Please respond
>  to "Log4J Users
>  List"
>
>
>
>
>
>I believe log4j1.3 has LoggerRepository.isPristine() which will tell
you
>that, but that's not available in the 1.2.8 release.  The only way I
could
>think of doing it is doing as you suggest, and analyzing any attached
>appenders, or checking for any logger in the hierachy that has a
non-null
>Level, which would indicate that it has been 'touched', but this is
>obviously not ideal.
>
>cheers,
>
>Paul Smith
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, November 16, 2004 2:21 AM
>> To: [EMAIL PROTECTED]
>> Subject: How to determine if log4j has been configured
>>
>>
>>
>>
>>
>>
>> I have a number of applications that all derive from a common
>> base class. They
>> also share a log4j.properties file. Because having multiple
>> applications (running
>> in seperate VMs) writing to the same log file is disasterous, I
>> configure log4j
>> in the ctor by calling the property configurator:
>>
>>   props.load( this
>> .getClass().getClassLoader().getResourceAsStream( "log4j.properties"
) );
>>   PropertyConfigurator.configure( props );
>>
>> I then enumerate the appenders, and modify any FileAppenders to
specify a
>> sub-class specific log file.
>>
>> This is working fine for applications that run stand-alone.
>> However a couple of
>> these applications run as services under JBoss. In these cases I
>> get an error
>> when trying to log a message . The error is "ERROR: invalid
>> console appender
>> config detected, console stream is looping". I would like to
>> detect if log4j has
>> been configured (by JBoss) before I configure the
>> PropertyConfigurator (and skip
>> that if JBoss has already configured log4j).
>>
>> I tried this code prior to calling the PropertyConfigurator:
>> //  Logger rootLogger = Logger.getRootLogger();
>> //  if( rootLogger == null )
>> //System.out.println( "Root Logger not yet set!!" );
>> //  else
>> //  {
>> //System.out.println( "Root logger already set!" );
>> //Enumeration appenders =
rootLogger.getAllAppenders();
>> //while( appenders.hasMoreElements() )
>> //{
>> //  System.out.println(
>> ((Appender)appenders.nextElement()).getName() );
>> //}
>> //  }
>>
>> But it said that there were 2 appenders (named FILE and CONSOLE).
>> I'm guessing
>> that getting the root logger (or else the appenders) caused log4j
>> to load a
>> default configuration. So, is there a way I can tell if log4j is
>> configured, and
>> if that configuration is other than the default configuration?
>> Other than by
>> testing for a known named appender specified in the JBoss log4j
>> configuration
>> file (which I really have no control over)?
>>
>> TIA,
>> Dave
>>
>> We must begin not just to act, but to think, for there is no better
slave
>> than the one who believes his slavery to be freedom, and we are in
>> no greater peril than when we cannot see the chains on our minds
>> because there are yet no chains on our feet.
>> -- Michael Reid
>>
>>
>> This message co

RE: disabling autoconfiguration

2004-11-15 Thread Shapira, Yoav

Hi,

>Would a system property be useful here?

A lightbulb went on when I read that, followed by a smack to the side of
my head: there's already one!

Setting the system property log4j.defaultInitOverride overrides the
default init procedure.  This is documented in the short manual.  OP:
give it a shot.

Yoav




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: disabling autoconfiguration

2004-11-15 Thread Shapira, Yoav

Hi,
Given the fact autoconfiguration runs in a static initializer, it only seems 
possible to circumvent with a custom classloader.  It's a lot less effort to 
simply not have log4j.properties/log4j.xml on the classpath than it is to start 
mucking with custom loaders for this purpose.

So no, I don't think it'd be useful to have such a custom loader included 
log4j.  The work/reward ratio is far too high.  It's always the application 
deployer's responsibility to control the classpath, including not only classes 
but also artifacts used as classloader resources.  Repackaging 3rd party jars 
to do this is one way, getting on the 3rd party's case to package their jars in 
a more developer-friendly way is another, and both ways are better than the 
band-aid approach you suggest IMHO.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Ricardo Trindade [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 15, 2004 1:38 PM
>To: Log4J Users List
>Subject: Re: disabling autoconfiguration
>
>But do you think it would be possible / usefull ?
>
>thanks
>Ricardo
>
>Ceki Gülcü wrote:
>
>> Auto-configuration occurs when the log4j classes are loaded into
>> memory. It is not dependent on any particular configurator.
>>
>>
>> At 05:07 PM 11/15/2004, Ricardo Trindade wrote:
>>
>>> Well, this could be simplistic, but perhaps :
>>>
>>> JoranConfigurator logConfigurator = new JoranConfigurator(); ->
>>> current behaviour
>>> JoranConfigurator logConfigurator = new JoranConfigurator( boolean
>>> autoinit ); -> user can specify if auto-init occurs
>>>
>>> thanks
>>> Ricardo
>>>
>>> Ceki Gülcü wrote:
>>>

 How do you suggest the automatic configuration feature be turned
 off. More specifically, how do you think the user pass this
 instruction to log4j?
>>>
>>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: How to determine if log4j has been configured

2004-11-15 Thread Shapira, Yoav

Hi,
This wiki page has code to determine whether log4j has been configured
or not: http://wiki.apache.org/logging-log4j/UsefulCode.  It is good
practice to use this or similar code instead of always calling
Configurator#configure.

Your detection code is somewhat close (more in spirit) of the above
code, but its implementation is lacking a bit.

One further point: for detecting whether log4j has been configured, it's
good to inspect the root logger and its appenders.  However, note that
app servers or other libraries may attach appenders not to the root
logger, but to their own package root.  For example, Tomcat attaches its
appenders in org.apache.catalina and below.  You can follow the same
practice and achieve better isolation of your appenders from other
programs' within the same JVM.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Monday, November 15, 2004 10:21 AM
>To: [EMAIL PROTECTED]
>Subject: How to determine if log4j has been configured
>
>
>
>
>
>I have a number of applications that all derive from a common base
class.
>They
>also share a log4j.properties file. Because having multiple
applications
>(running
>in seperate VMs) writing to the same log file is disasterous, I
configure
>log4j
>in the ctor by calling the property configurator:
>
>  props.load( this
>.getClass().getClassLoader().getResourceAsStream( "log4j.properties" )
);
>  PropertyConfigurator.configure( props );
>
>I then enumerate the appenders, and modify any FileAppenders to specify
a
>sub-class specific log file.
>
>This is working fine for applications that run stand-alone. However a
>couple of
>these applications run as services under JBoss. In these cases I get an
>error
>when trying to log a message . The error is "ERROR: invalid console
>appender
>config detected, console stream is looping". I would like to detect if
>log4j has
>been configured (by JBoss) before I configure the PropertyConfigurator
(and
>skip
>that if JBoss has already configured log4j).
>
>I tried this code prior to calling the PropertyConfigurator:
>//  Logger rootLogger = Logger.getRootLogger();
>//  if( rootLogger == null )
>//System.out.println( "Root Logger not yet set!!" );
>//  else
>//  {
>//System.out.println( "Root logger already set!" );
>//Enumeration appenders = rootLogger.getAllAppenders();
>//while( appenders.hasMoreElements() )
>//{
>//  System.out.println(
>((Appender)appenders.nextElement()).getName() );
>//}
>//  }
>
>But it said that there were 2 appenders (named FILE and CONSOLE). I'm
>guessing
>that getting the root logger (or else the appenders) caused log4j to
load a
>default configuration. So, is there a way I can tell if log4j is
>configured, and
>if that configuration is other than the default configuration? Other
than
>by
>testing for a known named appender specified in the JBoss log4j
>configuration
>file (which I really have no control over)?
>
>TIA,
>Dave
>
>We must begin not just to act, but to think, for there is no better
slave
>than the one who believes his slavery to be freedom, and we are in
>no greater peril than when we cannot see the chains on our minds
>because there are yet no chains on our feet.
>-- Michael Reid
>
>
>This message contains information from Equifax Inc. which may be
>confidential and
>privileged.  If you are not an intended recipient, please refrain from
any
>disclosure, copying, distribution or use of this information and note
that
>such
>actions are prohibited.  If you have received this transmission in
error,
>please
>notify by e-mail [EMAIL PROTECTED]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


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



RE: [easy] can i download log4j 1.3 or must i build it ?

2004-11-03 Thread Shapira, Yoav

Hi,
It is a mistake to perceive these as official distributions and rely on
them as such.  They're there for developer convenience purposes only,
may contain bugs, are not related to a CVS tag (in most cases, which
means they can't be reproduced), and are not supported in any way.
Other than that, yeah you can download and use them if you want.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Amit Nigam [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, November 03, 2004 9:25 AM
>To: 'Log4J Users List'
>Subject: RE: [easy] can i download log4j 1.3 or must i build it ?
>
>Here is the directory where these hand-built jars are stored (and
>downloaded
>by Web Start):
>http://logging.apache.org/log4j/docs/webstart/chainsaw/lib/
>
>
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]
>Sent: Wednesday, November 03, 2004 8:04 PM
>To: [EMAIL PROTECTED]
>Subject: [easy] can i download log4j 1.3 or must i build it ?
>
>
>Hi Log4j users,
>
>i don't find the download zone for snapshots or alpha versions on
Apache
>site. Must i check out from CVS sources and build the 1.3 version
myself ?
>
>Thank you.
>
>
>
>
>This message and any attachments (the "message") is
>intended solely for the addressees and is confidential.
>If you receive this message in error, please delete it and
>immediately notify the sender. Any use not in accord with
>its purpose, any dissemination or disclosure, either whole
>or partial, is prohibited except formal approval. The internet
>can not guarantee the integrity of this message.
>BNP PARIBAS (and its subsidiaries) shall (will) not
>therefore be liable for the message if modified.
>
>-
>
>Ce message et toutes les pieces jointes (ci-apres le
>"message") sont etablis a l'intention exclusive de ses
>destinataires et sont confidentiels. Si vous recevez ce
>message par erreur, merci de le detruire et d'en avertir
>immediatement l'expediteur. Toute utilisation de ce
>message non conforme a sa destination, toute diffusion
>ou toute publication, totale ou partielle, est interdite, sauf
>autorisation expresse. L'internet ne permettant pas
>d'assurer l'integrite de ce message, BNP PARIBAS (et ses
>filiales) decline(nt) toute responsabilite au titre de ce
>message, dans l'hypothese ou il aurait ete modifie.
>
>
>-
>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: [easy] can i download log4j 1.3 or must i build it ?

2004-11-03 Thread Shapira, Yoav

Hi,
Yeah, you need to build it yourself.  There hasn't been an official
1.3.0alpha release yet.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]
>Sent: Wednesday, November 03, 2004 9:34 AM
>To: [EMAIL PROTECTED]
>Subject: [easy] can i download log4j 1.3 or must i build it ?
>
>Hi Log4j users,
>
>i don't find the download zone for snapshots or alpha versions on
Apache
>site. Must i check out from CVS sources and build the 1.3 version
myself ?
>
>Thank you.
>
>
>
>
>This message and any attachments (the "message") is
>intended solely for the addressees and is confidential.
>If you receive this message in error, please delete it and
>immediately notify the sender. Any use not in accord with
>its purpose, any dissemination or disclosure, either whole
>or partial, is prohibited except formal approval. The internet
>can not guarantee the integrity of this message.
>BNP PARIBAS (and its subsidiaries) shall (will) not
>therefore be liable for the message if modified.
>
>-
>
>Ce message et toutes les pieces jointes (ci-apres le
>"message") sont etablis a l'intention exclusive de ses
>destinataires et sont confidentiels. Si vous recevez ce
>message par erreur, merci de le detruire et d'en avertir
>immediatement l'expediteur. Toute utilisation de ce
>message non conforme a sa destination, toute diffusion
>ou toute publication, totale ou partielle, est interdite, sauf
>autorisation expresse. L'internet ne permettant pas
>d'assurer l'integrite de ce message, BNP PARIBAS (et ses
>filiales) decline(nt) toute responsabilite au titre de ce
>message, dans l'hypothese ou il aurait ete modifie.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: CVS revision Tag questions

2004-10-15 Thread Shapira, Yoav

Hi,
You can use PREALPHA_1_3_AS_OF_2004_05_12 most likely, or simply the
v1_2-branch tag.

Yoav Shapira http://www.yoavshapira.com


>-Original Message-
>From: Doug Clifton [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 15, 2004 3:01 PM
>To: Log4J Users List
>Subject: CVS revision Tag questions
>
>I'm trying to retrieve the source for 2 versions of log4j. - v 1.2.3
and v
>1.2.8
>  and i need to determine the cvs tags for these versions (1.2.3 and
>1.2.8), I
>assume.  After reviewing the CVS access online, I "think" the proper
>retrieval
>tag for v 1.2.3 is v1_2_3 (please correct if I'm wrong), but I can't
seem
>to
>locate a tag for version 1.2.8 (matching the current binaries).  Would
>someone
>please enlighten me or point me in the right direction.
>
>  Thanks,
>   Doug Clifton
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Log4J configuration for library

2004-10-08 Thread Shapira, Yoav

Hi,
First, please be more specific than just "the configuration gets messed up."  Our 
ability to help you is mostly limited by the quality and quantity of the information 
you provide.

The common problem when developing libraries is the need to allow the user of the 
library to configure its logging.  There is code on the log4j wiki that shows you how 
to check if log4j has already been configured.  You can do this check, and then either 
throw a (possibly fatal) exception if log4j is not configured, or configure it 
yourself.  This is a fairly safe approach.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Nestor Boscan [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 08, 2004 2:26 PM
>To: [EMAIL PROTECTED]
>Subject: Log4J configuration for library
>
>Hi
>
>I'm developing a library and I'm using Log4J. I've had problems with
>applications that use the library and use log4j at the same time. For some
>reason the configuration gets messed up. I'm using a log4j.properties file
>inside de .jar library. Is there a correct way to configure log4j for
>libraries?
>
>Regards,
>
>Néstor Boscán
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: muting appenders

2004-10-01 Thread Shapira, Yoav

Hi,
You can modify the levels for loggers and the thresholds for appenders on the fly, no 
problem.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ionel GARDAIS [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 01, 2004 11:13 AM
>To: [EMAIL PROTECTED]
>Subject: muting appenders
>
>Hi,
>
>Sorry for the repost, I may have missed your answers.
>
>I have two appenders : ConsoleAppender and
>FileAppender.
>These two appenders are attached to a unique logger.
>
>Is there a way to "mute" a logger or the other "on the
>fly" so I can log on Console only, FileAppender only
>or both ?
>
>BTW, my logging initialization is like this :
>
>
>Logger log4jLogger = null;
>static {
>  Layout patternLayout = new PatternLayout("%d [%t]
>%-5p - %m%n");
>  Appender consoleAppender = new
>ConsoleAppender(patternLayout);
>  log4jLogger = Logger.getLogger("myClass");
>  log4jLogger.addAppender(consoleAppender);
>  log4jLogger.setLevel(Level.ALL);
>}
>
>
>As i am adapting a proprietary logging API to Log4j,
>this is the only initialization part I am going thru.
>Classes never reference the log4jLogger logger.
>
>According to this, what about the rootLogger ?
>What are its configuration values (appenders, level) ?
>Should I better use
>
>  log4jLogger = Logger.getRootLogger();
>
>instead of
>
>  log4jLogger = Logger.getLogger("myClass");
>
>
>in order to init only the root logger ?
>
>
>Ionel
>
>
>
>
>
>
>Vous manquez d'espace pour stocker vos mails ?
>Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
>Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
>Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés
>pour dialoguer instantanément avec vos amis. A télécharger gratuitement sur
>http://fr.messenger.yahoo.com
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Making the logger private

2004-10-01 Thread Shapira, Yoav

Hi,
I always use
private static final Logger LOGGER = Logger.getLogger(Foo.class);

I use static final instead of final static because the former is the JLS
recommended order, and tools like Checkstyle complain if you don't
comply, but the functionality is the same obviously.

I use private because public is an anti-pattern, package-scope is almost
as bad, and I don't want to use protected because I want to force
classes/people who extend my own classes to provide their own Logger for
better separation and identification.

This scheme has worked well for me in production, on big and small apps,
in and out of Servlet and J2EE contaienrs, for years now.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: McCarty, Brian [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 01, 2004 10:48 AM
>To: Log4J Users List
>Subject: RE: Making the logger private
>
>I normally declare them private, because they are specific to each of
my
>Classes.  But what about 'final'?  I have seen it done both ways in
>examples so I am not sure what's best.
>
>Should I use:
>   private final static Logger
>or
>   private static Logger...
>
>Thanks for helping with my understanding.
>
>Brian
>
>PS: I have a short lived "user" application and a long running app
>server application both to think about.
>
>-Original Message-
>From: Jim Moore [mailto:[EMAIL PROTECTED]
>Sent: Friday, October 01, 2004 8:49 AM
>To: Log4J Users List
>Subject: Re: Making the logger private
>
>I'm not sure what exampled you're referring to showing the public
>usage -- most everything I could find shows it being either private or
>"package"...
>
>The two canonical ways of creating Loggers are:
>  private static final Logger LOG = Logger.getLogger(MyClass.class);
>or
>  private final Logger logger = Logger.getLogger(getClass());
>
>The static route is nice because (assuming you have many more
>instances than you have classes) it's more efficient, and when it logs
>you know exactly what class the logging is coming from so it's easy to
>track down where it happened.  However, if it's a class that likely
>will be extended from, it doesn't tell you exactly what "kind" of
>instance the calling object really is.  The advantages/disadvantages
>are reversed for the non-static logger.  It depends on your needs, of
>course, but in general the static Logger has the better cost/benefit
>ratio.
>
>That said, making Logger public would actually be an anti-pattern.
>"Sharing" a Logger between classes makes it extremely difficult and
>misleading to determine where the logging is taking place.  Logger
>instances aren't zero-cost, but they aren't expensive either, so
>unless you have extreme performance requirements, it's best to do what
>makes debugging easier, which is either a Logger-per-class or a
>Logger-per-instance.  If you absolutely need a "public Logger", use
>the root logger (Logger.getRootLogger()).
>
>There are some special-case exceptions, though, that basically
>boil-down to trying to do AOP without actually doing AOP.  An example
>is having a SQL_LOGGER that's used across classes when doing SQL.
>That's better handled using other techniques, however.
>
>-Jim Moore
>
>
>On Fri, 1 Oct 2004 09:56:57 +0100, [EMAIL PROTECTED]
><[EMAIL PROTECTED]> wrote:
>>
>> Hi all
>>
>> just a little question.
>> In all log4j examples I see the logger is integrated as
>>
>> public static Logger logger = new Logger(x.class);
>>
>> If I understand it correct, it is static to enhance the performance,
>as
>> only one instance of the logger is used for all instantiations of
>class x.
>> But why is it public? I would make it private as it is referenced
only
>in
>> the class x, not outside.
>>
>> And if i don't want to extend the class x, I would make it final.
>>
>> Thus in my example it would be:
>> private static final Logger logger = new Logger(x.class);
>>
>> Are there any arguments speaking against this usage? Please make
>> suggestions.
>>
>> Thanks Herb
>
>-
>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Reloading the properties file

2004-09-29 Thread Shapira, Yoav

Hi,
And I would not use configureAndWatch in a J2EE app server because
you're not supposed to launch your own threads in that environment.  And
I would not use a ServletContext#getRealPath approach because it would
fail when running in a packed WAR or EAR.  And I would not rely on the
user.dir or other environment-specific settings because that's cruising
for a bruising from a portability perspective.  So take Jake's advice ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Jacob Kjome [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 29, 2004 11:46 AM
>To: Log4J Users List
>Subject: RE: Reloading the properties file
>
>You can always use one of the web based Log4j configuration admin apps
>listed in
>3rd party extensions on the Log4j download page...
>
>http://logging.apache.org/log4j/docs/download.html
>
>I would *not* use configureAndWatch() in a webapp because it generates
a
>thread
>that may cause the java.lang.ThreadDeath error upon application reload
>(that
>is, without shutting down the VM/Server).
>
>Jake
>
>Quoting "Prasad, Kamakshya" <[EMAIL PROTECTED]>:
>
>> Hi,
>>
>> No I have not implemented any configurator. Currently on application
>> start-up it gets loaded from the web-inf/classes.
>> What we were thinking that after application has started up something
>> changes then how to configure.
>> If we call only configure and not configurewatch then will it be
fine.
>> The system admin when changes the file he has to reload the file in
the
>> memory by manually clicking on the button.
>>
>> KP
>>
>> -Original Message-
>> From: Ivan Jouikov [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, September 29, 2004 4:17 PM
>> To: 'Log4J Users List'
>> Subject: RE: Reloading the properties file
>>
>> Writing a servlet to call configure and watch?
>>
>> When you configure log4j using DOMConfigurator, and use
>> configureAndWatch, it automatically reloads that file when it
changes.
>> You don't need to invoke anything.
>>
>> > -Original Message-
>> > From: Prasad, Kamakshya [mailto:[EMAIL PROTECTED]
>> > Sent: Tuesday, September 28, 2004 11:27 PM
>> > To: [EMAIL PROTECTED]
>> > Subject: Reloading the properties file
>> >
>> > Hi All,
>> >
>> >
>> >
>> > We have a j2ee web application using log4j for logging purpose.
>> Nowadays
>> > quite frequently we have to switch on and switch off the debugging
>> > mechanism.
>> >
>> > The properties file is in web-inf/classes.
>> >
>> > We have to load the configuration file whenever it changes.
>> >
>> > We are planning to write a servlet which calls the
>> PropertyConfigurator
>> > configureAndWatch method to reload the properties file.
>> >
>> > But we just read through the log4j faq that this is unsafe.
>> >
>> > Please advice me the best way to implement this reloading
mechanism.
>> >
>> >
>> >
>> > KP
>> >
>> >
>> > ---
>> > Incoming mail is certified Virus Free.
>> > Checked by AVG anti-virus system (http://www.grisoft.com).
>> > Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>> >
>>
>> ---
>> Outgoing mail is certified Virus Free.
>> Checked by AVG anti-virus system (http://www.grisoft.com).
>> Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>>
>>
>>
>> -
>> 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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: writing to 2 different log files at same time

2004-09-28 Thread Shapira, Yoav

Hi,
You can go about this several ways.  Here's one option, in a properties
configuration format.

# Define log file (appender) for "processing actions"
log4j.appender.processingActionsAppender = org.apache.log4j.FileAppender
...

# Define log file (appender) for "database actions"
log4j.appender.databaseActionsAppender = org.apache.log4j.FileAppender
...

# Attach processing actions appender to processing actions logger
log4j.logger.processingActions = DEBUG, processingActionsAppender

# Attach database actions appender to database actions logger
log4j.logger.databaseActions = DEBUG, databaseActionsAppender

# Set additivity to false for both
log4j.logger.processingActions.additivity = false
log4j.logger.databaseActions.additivity = false

You would configure log4j normally using this properties configuration
file.  Then your app would log to the "processing actions" logger by
doing
Logger proccessingActions = Logger.getLogger("processingActions");
processingActions.info("foo");

And to the databaseActions logger by doing
Logger databaseActions = Logger.getLogger("databaseActions");
databaseActions.info("bar");

If you want to increase performance and save overhead, you can put these
two loggers in a common class for your app, and add
logDatabaseAction(...) and logProcessingAction(...) methods to that
class.

That's one way.  There are others ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Swati Vakharia [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, September 28, 2004 3:01 PM
>To: [EMAIL PROTECTED]
>Subject: writing to 2 different log files at same time
>
>Hi I'm trying to use log4j to write to two different log files at
>different time . For example I want one log file to track my
>"processing actions" and another log file to track my "database
>actions" . I tried setting up different loggers in the configuration
>but it always seems to be writing all actions (processing and
>database) to both files no matter what i do. Any help would be
>appreciated.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: using java.io.tmp in properties file

2004-09-28 Thread Shapira, Yoav

Hi,
Yup, use the Ant-like syntax ${java.io.tmp}  (I actually think you mean
java.io.tmpdir by the way).


Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, September 28, 2004 12:00 PM
>To: [EMAIL PROTECTED]
>Subject: using java.io.tmp in properties file
>
>Hi guys,
>
>We use log4j for just about everything.  I tried to do a search for
this
>but I'm coming up empty.  Can anyone tell me if its possible to use the
>System property java.io.tmp in a log4j properties file?
>
>Thanx in advance.
>
>Roy.
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How to use log4j in applet?

2004-09-28 Thread Shapira, Yoav

Hi,
Yes.  See the SocketAppender JavaDoc.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Monday, September 27, 2004 4:25 PM
>To: Log4J Users List; Shapira, Yoav
>Subject: RE: How to use log4j in applet?
>
>Zitiere "Shapira, Yoav" <[EMAIL PROTECTED]>:
>
>Hi Yoav,
>
>thank you for your answer.
>
>I want to log error messages from an applet into a log-file on the
server,
>not
>at the client. If somebody uses the applet and an error occurs, I can
check
>the
>detailed error in the log-file at the server.
>
>Do You have an idea how to realize logging with log4j in an applet?
>
>Baris
>
>>
>> Hi,
>> You could use log4j for a lot more than writing files.  For example
to
>> send emails, send JMS messages, or in fact in messages to a
>> SocketAppender.  Any of these can be valid use-cases.  Obviously, one
>> also CAN write to files on the user's system with the appropriate
Applet
>> certificates and security policy (which are frequently provided in
>> intranet settings).
>>
>> Yoav Shapira
>> Millennium Research Informatics
>>
>>
>> >-Original Message-
>> >From: Ivan Jouikov [mailto:[EMAIL PROTECTED]
>> >Sent: Monday, September 27, 2004 1:34 PM
>> >To: 'Log4J Users List'
>> >Subject: RE: How to use log4j in applet?
>> >
>> >Why would you want to use log4j in an applet?  You aren't allowed to
>> write
>> >into files on the user's system.  If you need to do debugging -
what's
>> >wrong with System.out?
>> >
>> >> -Original Message-
>> >> From: Baris Yalcin [mailto:[EMAIL PROTECTED]
>> >> Sent: Monday, September 27, 2004 2:26 AM
>> >> To: [EMAIL PROTECTED]
>> >> Subject: How to use log4j in applet?
>> >>
>> >> Hi everyone,
>> >>
>> >> I would like to use log4j in an applet. Unfortunately I couldn't
find
>> any
>> >> example.
>> >>
>> >> Is there any documentation which shows how to configure log4j with
>> >> applets?
>> >>
>> >> Or does somebody have an example for me (applet and log4j.xml) how
to
>> >> realize
>> >> logging with log4j in an applet?
>> >>
>> >> Thanks a lot in advance,
>> >>
>> >> Baris
>> >>
>> >>
>> >>
>> >>
>> >>
-
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail:
[EMAIL PROTECTED]
>> >>
>> >> ---
>> >> Incoming mail is certified Virus Free.
>> >> Checked by AVG anti-virus system (http://www.grisoft.com).
>> >> Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>> >>
>> >
>> >---
>> >Outgoing mail is certified Virus Free.
>> >Checked by AVG anti-virus system (http://www.grisoft.com).
>> >Version: 6.0.766 / Virus Database: 513 - Release Date: 17.09.2004
>> >
>> >
>> >
>>
>-
>> >To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>> This e-mail, including any attachments, is a confidential business
>> communication, and may contain information that is confidential,
>> proprietary and/or privileged.  This e-mail is intended only for the
>> individual(s) to whom it is addressed, and may not be saved, copied,
>> printed, disclosed or used by anyone else.  If you are not the(an)
>> intended recipient, please immediately delete this e-mail from your
>> computer system and notify the sender.  Thank you.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Quick question...

2004-09-24 Thread Shapira, Yoav

Hi,

>Config is this (not BasicConfigurator.configure)

That's the configuration file (and it looks fine).  But I was asking
more specifically is how you configure log4j?
- Do you put this file in WEB-INF/classes and rely on automatic
configuration?
- Or do you configure log4j programmatically, and if so how?

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Quick question...

2004-09-24 Thread Shapira, Yoav

Hi,
How are you configuring log4j?  Using BasicConfigurator.configure adds a
console appender.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Greg Michalopoulos [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 24, 2004 9:36 AM
>To: 'Log4J Users List'
>Subject: Quick question...
>
>I am using Jrun4 with log4j and I have enabled some logging to a text
file,
>but the entries also get outputted to the console.  Is there any config
so
>that I can turn off the output to the console - while still logging to
the
>file?
>
>Thanks,
>Greg
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How to distribute messages in different files ?

2004-09-23 Thread Shapira, Yoav

Hi,
You don't have to attach appenders to the root logger.  Attach the context1 appender 
only to the context1 logger, attach the context2 appender only to the context2 logger, 
and attach the Tomcat appender only to the org.apache.catalina logger.


Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Jean-Paul Le Fèvre [mailto:[EMAIL PROTECTED]
>Sent: Thursday, September 23, 2004 10:30 AM
>To: [EMAIL PROTECTED]
>Subject: How to distribute messages in different files ?
>
>I would like to configure the messages issued by my webapps
>in Tomcat 5.5. I've been working on the log4j properties a long time but
>without success.
>
>My hope is to get 3 logfiles : a general one for Tomcat (say catalina.out)
>and one of each of my 2 contexts.
>
>My log4j.properties file looks like :
>
>log4j.rootLogger=INFO, A, R, L
>log4j.logger.org.apache.catalina.core.ContainerBase.Catalina.localhost./pat
>h1=INFO,R
>log4j.logger.org.apache.catalina.core.ContainerBase.Catalina.localhost./pat
>h1=INFO,L
>...
>log4j.appender.A=org.apache.log4j.ConsoleAppender
>...
>log4j.appender.R.File=/home/lefevre/soft/Tomcat/logs/file1.log
>...
>log4j.appender.L.File=/home/lefevre/soft/Tomcat/logs/file2.log
>...
>
>And I've experimented lot of additivity values but I'm still unable to
>separate messages, either they go simultaneously in 2 or 3 files or they
>are
>appended in a single file.
>
>BTW It is not clear from what I've read if additivity has to be set with
>log4j.additivity.my.category=true
>or
>log4j.logger.my.category.additivity=true
>
>Thank you for your help,
>
>--
>___
>
>Jean-Paul Le Fèvre  * Mail : [EMAIL PROTECTED]
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: web app using log4j not garbage collected when shutdown with tomcat manager app

2004-09-22 Thread Shapira, Yoav

Hi,
Wow, good work!  I'm attaching a reference to the archive of this thread to the 
Bugzilla issues.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Paulsen, Jay [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 22, 2004 8:45 AM
>To: Log4J Users List
>Subject: RE: web app using log4j not garbage collected when shutdown with
>tomcat manager app
>
>Ceki,
>
>I think I've found a workaround for this problem.
>
>Debugging the log4j property configuration code when executing test case 3,
>I noticed it used the java.beans package in PropertySetter to set the
>ConversionPattern property of the appender layout object.  This code
>doesn't get executed in the other testcases because no Layout parameters
>(including ConversionPattern) are specified (at least not specified via the
>configuration file).
>
>After googling a bit on "Inspector", "memory", "leak" I found a few clues
>that led to the inspection of the java.beans.Introspector class.  This
>class includes the following comment in its javadoc:
>
> * Because the Introspector caches BeanInfo classes for better performance,
> * take care if you use it in an application that uses
> * multiple class loaders.
> * In general, when you destroy a ClassLoader
> * that has been used to introspect classes,
> * you should use the
> * [EMAIL PROTECTED] #flushCaches Introspector.flushCaches}
> * or
> * [EMAIL PROTECTED] #flushFromCaches Introspector.flushFromCaches}
>method
> * to flush all of the introspected classes out of the cache.
>
>I then added a call to Introspector.flushCaches() in
>SimpleServlet.destroy() after the call to LogManager.shutdown().  With this
>additional line of code, test case 3 is now successful - the web app
>classes and the tomcat web app class loader are now garbage collected.
>
>
>Does this seem like a reasonable explanation/solution?  This doesn't appear
>to be a log4j issue (I hope I didn't cause anyone any extra work).  I would
>guess that maybe Tomcat should call Introspector.flushCaches() when it
>shuts down a web app since it's throwing away the classloader for the web
>app.  For now, I'll include this line of code during web app shutdown.
>
>Hope this helps,
>-Jay
>
>
>
>
>> -Original Message-
>> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, September 22, 2004 7:23 AM
>> To: Log4J Users List
>> Subject: Re: web app using log4j not garbage collected when
>> shutdown with tomcat manager app
>>
>>
>> Jay,
>>
>> First, thank you for providing such a detailed and precise report.
>>
>> Looking at the differences between different tests, I find cases 3 and
>> 4 most  interesting to  compare because they  are nearly  identical in
>> configuration   but   while  the   former   test   fails  the   latter
>> succeeds.  Their  only difference  is  that Test  3  uses
>> the a  date conversion  specifier (%d{DATE})  while Test  4
>> only  a  relative time converter. In light of this
>> difference, it is impossible to explain why test 3 fails
>> while test 4 succeeds.
>>
>> Before  spending more  time  about  this problem,  are  you
>> sure  that failure of test 3 and success of test 4 are reproducible?
>>
>> At 06:23 PM 9/21/2004, Paulsen, Jay wrote:
>> >Are there any known problems with using the Tomcat manager app to
>> >shutdown web apps that use log4j?  I have a web app that
>> leaks memory
>> >everytime I use the manager app to shut it down.  To help narrow the
>> >problem down, I set up a simple web app with one servlet and log4j
>> >1.2.8.  Depending on what type of log4j configuration the
>> web app uses,
>> >the web app classloader does not get garbage collected which
>> means all
>> >of the classes it loaded and any static references that
>> these classes
>> >may have all stay in memory.  When the manager app is used
>> to restart
>> >the app, a new webapp class loader is created and the
>> classes for the
>> >web are loaded again.  The old class loader is pinned in
>> memory by some
>> >reference.
>> >
>> >
>> >All tests used this log4j configuration in log4j.properties:
>> >log4j.debug=true
>> >log4j.rootLogger=DEBUG, CONSOLE
>> >log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>> >
>> >Each test deployed log4j.jar in the web app context class
>> path.  A URI
>> >of the web app was invoked to load the web app's servlet.
>> The app was
>> >then shutdown using the Tomcat manager app.  A memory
>> snapshot was then
>> >taken with YourKit Java Profiler 2.5.1 to inspect the classes and
>> >instances still remaining in memory.
>> >
>> >Test 1: Simple layout:
>> >log4j.appender.CONSOLE.layout=org.apache.log4j.SimpleLayout
>> >Result: successful - web app garbage collected
>> >
>> >Test 2: Pattern layout with no conversion pattern specified:
>> >log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>> >Result: successful - web app garbage collected
>> >
>> >Test 3: Pattern layout with a conversion pattern specified:
>> >log4j.appender.CONSOLE.layout=org.apache.log4j.Patt

RE: web app using log4j not garbage collected when shutdown with tomcat manager app

2004-09-21 Thread Shapira, Yoav

Hi,
Aaah, good findings!  Maybe this will let us make progress on
http://issues.apache.org/bugzilla/show_bug.cgi?id=26372 and
http://issues.apache.org/bugzilla/show_bug.cgi?id=27371.

Thanks for posting!

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Paulsen, Jay [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, September 21, 2004 12:23 PM
>To: [EMAIL PROTECTED]
>Subject: web app using log4j not garbage collected when shutdown with
>tomcat manager app
>
>Are there any known problems with using the Tomcat manager app to
>shutdown web apps that use log4j?  I have a web app that leaks memory
>everytime I use the manager app to shut it down.  To help narrow the
>problem down, I set up a simple web app with one servlet and log4j
>1.2.8.  Depending on what type of log4j configuration the web app uses,
>the web app classloader does not get garbage collected which means all
>of the classes it loaded and any static references that these classes
>may have all stay in memory.  When the manager app is used to restart
>the app, a new webapp class loader is created and the classes for the
>web are loaded again.  The old class loader is pinned in memory by some
>reference.
>
>
>All tests used this log4j configuration in log4j.properties:
>log4j.debug=true
>log4j.rootLogger=DEBUG, CONSOLE
>log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>
>Each test deployed log4j.jar in the web app context class path.  A URI
>of the web app was invoked to load the web app's servlet.  The app was
>then shutdown using the Tomcat manager app.  A memory snapshot was then
>taken with YourKit Java Profiler 2.5.1 to inspect the classes and
>instances still remaining in memory.
>
>Test 1: Simple layout:
>log4j.appender.CONSOLE.layout=org.apache.log4j.SimpleLayout
>Result: successful - web app garbage collected
>
>Test 2: Pattern layout with no conversion pattern specified:
>log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>Result: successful - web app garbage collected
>
>Test 3: Pattern layout with a conversion pattern specified:
>log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>log4j.appender.CONSOLE.layout.ConversionPattern=%d{DATE} %t %-5p [%x]
%c
>%m%n
>Result: unsuccessful - web app and tomcat webapp classloader still in
>memory - not garbage collected
>
>Test 4: Log4J configured with call to BasicConfigurator.configure()
>instead of using log4j.properties file.
>Result: successful - web app garbage collected
>
>Test 5: Same as Test 3 except now log4j.jar deployed in
>tomcat/shared/lib classpath instead of web app context class path:
>Result: successful - web app garbage collected (log4j classes and
>instances still in memory since the shared class path classloader is
not
>reloaded)
>
>
>Am I doing something wrong or out of the ordinary here or is there some
>issue with the configuration of a ConversionPattern using the
properties
>file?  Is it possible that something in this code is holding onto a
>reference to the web app class loader or some class of the web app?
>
>Any feedback is appreciated.
>-Jay
>
>
>
>
>
>
>
>
>Environment
>Tomcat 4.1.30
>Sun JDK 1.4.2-05
>Windows XP
>log4j 1.2.8
>
>
>
>* SimpleServlet.java:
>
>package z;
>
>
>import org.apache.log4j.Logger;
>import org.apache.log4j.LogManager;
>import org.apache.log4j.BasicConfigurator;
>
>import javax.servlet.http.HttpServlet;
>import javax.servlet.http.HttpServletRequest;
>import javax.servlet.http.HttpServletResponse;
>import javax.servlet.ServletException;
>import javax.servlet.ServletConfig;
>import java.io.IOException;
>import java.io.PrintWriter;
>import java.util.Date;
>
>public class SimpleServlet extends HttpServlet {
>   private static Logger log =
>LogManager.getLogger(SimpleServlet.class);
>
>
>   public void init(ServletConfig servletConfig) throws
ServletException
>{
>  super.init(servletConfig);
>
>  // This fixes it too when you do basic configuration instead of
>log4j.properties
>  // Notice that the basic configuration uses the PatternLayout
with
>a ConversionPattern
>  // THe problem must be in the parsing of the Pattern or
>Configuring of options
>  // when using log4j.properties?
>  // Uncomment the next two lines for test 4
>  //System.out.println("basic configuration");
>  //BasicConfigurator.configure();
>   }
>
>   protected void doGet(HttpServletRequest httpServletRequest,
>HttpServletResponse httpServletResponse) throws ServletException,
>IOException {
>
>  PrintWriter out = httpServletResponse.getWriter();
>  out.write("" +
>"Hello World " + new Date() +
>"");
>  out.flush();
>   }
>
>
>   public void destroy(){
>  super.destroy();
>
>  LogManager.shutdown();
>
>  System.out.println("Done");
>   }
>}
>
>* web.xml
>
>
>2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
>
>
>
>   
>  simpleservlet
>  z.SimpleServlet
>   
>
>   
>  simpleservlet
>  /*
>   
>
>
>
>
>

RE: Custom Levels

2004-09-17 Thread Shapira, Yoav

Hi,

>One thing which I am concerned about, should I have a log4j config xml
>file?  I have the log4j.properties file, but should this be replaced
>with the log4j.xml file, or does it not make any difference which route
>you chose?

It doesn't make much difference.  You can use Property or XML
configurator, either automatically (log4j.properties or log4j.xml on the
classpath) or programmatically.  You can also do your entire config
programmatically, manually creating the appenders and attaching them to
loggers, if you so desire.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Custom Levels

2004-09-17 Thread Shapira, Yoav

Hi,
I can't help with your actual problem, as I don't know its cause, but I
wanted to offer an alternative approach that involves much less work for
you.

Use an Admin Logger as a separate Logger, rather than a separate level.
Have a Singleton in your webapp which has

private static final Logger ADMIN_LOGGER =
Logger.getLogger("MYAPP_ADMIN_LOGGER");

public static Logger getAdminLogger() {
  return ADMIN_LOGGER;
}

or maybe
public static void warnAdmin(...) {
  ADMIN_LOGGER.warn(...);
}
etc.

The main advantage of this approach is that you don't need to write a
custom Level, a custom Logger, or a LoggerFactory.  In addition, you
still maintain clean separation of logging output for admin from other
logging output.  You can still configure whatever appenders (and
thresholds, and renders, etc.) you want just for the admin logger.  All
your classes can access it with negligible overhead via the singleton.
Much simpler, more streamlined than your approach, I think.  But it's
just a suggestion, feel free to ignore it ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Daniel, Gillian [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 17, 2004 5:58 AM
>To: Log4J Users List
>Subject: RE: Custom Levels
>
>Hi all, sorry to update you, but now in my console, I get confirmation
>that it can actually find my level as the following is output in my
>server, which indicates to me that it can find my custom level.  But I
>still get the null pointer exception when it tries to write to the
>SProLogger with my custom level.  The
>
>log4j:ERROR Could not find value for key
>log4j.appender.ADMIN#com.petrotechnics.xarc.log.SProLevel
>
>log4j:ERROR Could not instantiate appender named
>"ADMIN#com.petrotechnics.xarc.log.SProLevel".
>
>is not longer out put, and the following is in its place:
>
>CPLevel:CPLevel:level.levelStr,syslogEquivalent: 50001 ADMIN 5
>
>-Original Message-
>From: Daniel, Gillian
>Sent: 17 September 2004 10:49
>To: [EMAIL PROTECTED]
>Subject: Custom Levels
>
>Hi all,
>
>Have been searching for information to assist me in my problem for a
day
>now, and I really cannot find anything which is helping me, so I
thought
>that perhaps someone else would be able to point me in the direction I
>should be going.
>
>
>
>We are using Weblogic 8.1.  We also use the commons-logging along side
>the log4j.
>
>
>
>We require a custom Level, so that we can output the messages with this
>custom level to a different log file.  So I have created my custom
>level:
>
>
>
>
>
>package com.petrotechnics.xarc.log;
>
>
>
>import org.apache.log4j.*;
>
>
>
>public class SProLevel extends Level {
>
>
>
>public static final int ADMIN_INT = Level.FATAL_INT + 1;
>
>public final static String ADMIN_STR = "ADMIN";
>
>public final static SProLevel ADMIN = new SProLevel(ADMIN_INT,
>ADMIN_STR, 5);
>
>
>
>
>
>public SProLevel(int level, String levelStr, int syslogEquivalent)
{
>
>super(level, levelStr, syslogEquivalent);
>
>
>System.out.println("CPLevel:CPLevel:level,levelStr,syslogEquivalent:\n"
>
>   + level + " " + levelStr + " " +
>syslogEquivalent);
>
>} // end of SProLevel
>
>
>
>public static Priority toPriority(String sArg) {
>
>return toPriority(sArg, SProLevel.ADMIN);
>
>} // end of toPriority
>
>
>
>
>
>public static Priority toPriority(int i) throws
>IllegalArgumentException {
>
>return toPriority(i, SProLevel.ADMIN);
>
>} // end of toPriority
>
>
>
>
>
>public static Priority toPriority(int i, Priority priority) {
>
>Priority p = (i == ADMIN_INT) ?
>
>SProLevel.ADMIN :
>
>Priority.toPriority(i, priority);
>
>
>
>return p;
>
>} // end of toPriority
>
>
>
>
>
>public static Priority toPriority(String sArg, Priority priority) {
>
>Priority p = (sArg == null) ?
>
>SProLevel.ADMIN :
>
>((sArg.equalsIgnoreCase(SProLevel.ADMIN_STR)) ?
>
>SProLevel.ADMIN :
>
>Priority.toPriority(sArg, priority));
>
>
>
>return p;
>
>} // end of toPriority
>
>
>
>
>
>public static Level toLevel(String s) {
>
>return toLevel(s, SProLevel.ADMIN);
>
>} // end of toLevel
>
>
>
>
>
>public static Level toLevel(int i) {
>
>return toLevel(i, SProLevel.ADMIN);
>
>} // end of toLevel
>
>
>
>
>
>public static Level toLevel(int i, Level level) {
>
>Level l = (i == ADMIN_INT) ?
>
>SProLevel.ADMIN :
>
>Level.toLevel(i, level);
>
>
>
>return l;
>
>} // end of toLevel
>
>
>
>public static Level toLevel(String s, Level level) {
>
>Level l = (s == null) ?
>
>SProLevel.ADMIN :
>
>((s.equalsIgnoreCase(SProLevel.ADMIN_STR)) ?
>
>SProLevel.ADMIN :
>
>Level.toLevel(s, level));
>
>
>
>return l;
>
>} // end of toLevel
>
>
>
>
>
>public stat

RE: looking for guidance - logging in JSPs

2004-09-16 Thread Shapira, Yoav

Hi,
Or if not as part of log4j proper, then at least have a link to them on the 
logging.apache.org/log4j web site.  I'll take a look at adding something.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>Sent: Thursday, September 16, 2004 8:43 AM
>To: Log4J Users List
>Subject: RE: looking for guidance - logging in JSPs
>
>
>It'd be useful to include these tags as part of log4j.
>
>At 02:24 PM 9/16/2004, you wrote:
>>Right on. Check this out:
>>
>>http://jakarta.apache.org/taglibs/doc/log-doc/intro.html
>
>--
>Ceki Gülcü
>
>  For log4j documentation consider "The complete log4j manual"
>  ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: looking for guidance - logging in JSPs

2004-09-16 Thread Shapira, Yoav

Hi,
Would definitely add logging to the tags themselves, that's almost a
no-brainer.  What do you lose by doing that?  Nothing, I think.

As to whether you want to add logging to the JSPs themselves: it does
clutter them and make them have more Java, thereby reducing the EUD
potential.  However, logging is usually worth it.  What if you write a
logging JSP tag, e.g.

?  Is that a good solution?  Come to think of it, maybe something like
this already exists: check Jakarta Taglibs.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Lutz Michael [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 15, 2004 5:15 PM
>To: Log4J Users List
>Subject: looking for guidance - logging in JSPs
>
>
>
>My organization has made a stance to minimize the Java code in our
JSPs,
>specifically we only use custom tags and we only use them if necessary.
>
>Q: Given this position (which is hopefully realistic), in your opinion
(and
>experience) would you consider there a need to add logging and tracing
>calls
>to the custom tags?  In other words I'm trying to understand if it's
>worthwhile adding logging calls to JSP pages when the intent is to keep
JSP
>pages thin outside of custom tag usage.
>
>Thanks in advance for chiming in.
>
>Mike
>
>___
>Siemens Medical Solutions Health Services
>Michael Lutz
>Software Engineer, Soarian Common Components
>51 Valley Stream Parkway, Malvern, PA 19355
>Office / Voice Mail+01 610-219-8613
>Cell   +01 610-952-2289
>Home Office+01 610-989-3623
>Fax+01 610-219-4004
>E-mail 
>___
>
>
>---

>
>This message and any included attachments are from Siemens Medical
>Solutions
>USA, Inc. and are intended only for the addressee(s).
>The information contained herein may include trade secrets or
privileged or
>otherwise confidential information.  Unauthorized review, forwarding,
>printing,
>copying, distributing, or using such information is strictly prohibited
and
>may
>be unlawful.  If you received this message in error, or have reason to
>believe
>you are not authorized to receive it, please promptly delete this
message
>and
>notify the sender by e-mail with a copy to
>[EMAIL PROTECTED]
>
>Thank you
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: logging a stack trace

2004-09-15 Thread Shapira, Yoav

Hi,
Logger.error("Exception: ", e);

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Jeff Drew [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 15, 2004 9:57 AM
>To: Log4J Users List
>Subject: logging a stack trace
>
>How do I write a stack trace to a log?
>I found some references in the mail archives, but couldn't find a
solution.
>I couldn't find it in Ceki's book.   Here's a simple example of my
goal.
>Thanks!
>
>public class LogStackTrace {
> static Logger logger = Logger.getLogger("LogStackTrace");
>
> public static void main(String[] args) {
>  BasicConfigurator.configure();
>
>  try {
>   throw new NullPointerException();
>  } catch (Exception e) {
>   e.printStackTrace(); // *** how do I output this to log4j? ***
>   logger.error(e.getStackTrace()); // just writes the object id
>  }
> }
>}
>Jeffrey Drew
>President and Founder
>Trading Metrics, Inc.
>917-453-0302



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: this has to be super simple: different logger, multiple appenders, for different classes

2004-09-15 Thread Shapira, Yoav

Hi,
In your configuration file, define all six appenders.  Call them
stdout1, stdout2, email1, email2, file1, file2.  The syntax for this is
in the JavaDoc for the PropertyConfigurator class, as well as the Short
and Complete log4j manuals.  Set additivity to false for all six
appenders.

Maybe for stdout you want the same appender, since it's the same output
stream anyways?

Anyhow, then associate the logger for each class with the three
appenders for it, e.g.
log4j.logger.class1 = stdout1, email1, file1, DEBUG
log4j.logger.class2 = stdout2, email2, file2, DEBUG

And voila.  If you want XML configuration or programmatic configuration,
you can do that to.  As your surmised, this is indeed easy and simple.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Marc Esher (4-2060) [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 15, 2004 9:39 AM
>To: [EMAIL PROTECTED]
>Subject: this has to be super simple: different logger, multiple
appenders,
>for different classes
>
>All,
>
>  This has to be so simple: I have 2 classes, and I want each of those
>classes to use a different logger. Each logger will have an stdout,
>email, and file appender
>
>
>
>When I call the logger for Class1, I want to say getLogger("Class1")
and
>then have the 3 different appenders for that logger invoked.
>
>
>
>When I call the logger for Class2, I want to say getLogger("Class2")
and
>then have the 3 different append for that logger invoked.
>
>
>
>How does one do this?
>
>
>
>Thanks!




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: MDC in J2EE

2004-09-15 Thread Shapira, Yoav

Hi,
If you're talking about the RequestDispatcher#forward method, the
Servlet Spec guarantees that it will execute on the same thread as the
original request (Servlet Spec v2.4, section SRV.8.2, it's unambiguous),
so that's what you're missing there.

For EJB calls, I don't know, you might be right.  I don't work with them
as much nowadays, so I don't remember the spec as well.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Lutz Michael [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, September 15, 2004 9:21 AM
>To: 'Log4J Users List'
>Subject: MDC in J2EE
>
>
>
>According to the J2EE spec there is no guarantee that a .forward
request or
>an EJB call will execute on the same thread (even if the EJB call lands
in
>the same process).  This seems to render MDC and NDC much less useful
>because these constructs rely on the thread.  Changing it pulls the rug
out
>from under the mechanism.
>
>Am I missing something?  Is there a "standard" way Log4j users should
>handle
>MDC to ensure the context persists across .forward and EJB calls (when
in
>the same process)?
>
>I reviewed the Complete Manual and couldn't find anything related to
this
>question.
>
>Thanks for your time.
>
>Mike
>
>___
>Siemens Medical Solutions Health Services
>Michael Lutz
>Software Engineer, Soarian Common Components
>51 Valley Stream Parkway, Malvern, PA 19355
>Office / Voice Mail+01 610-219-8613
>Cell   +01 610-952-2289
>Home Office+01 610-989-3623
>Fax+01 610-219-4004
>E-mail 
>___
>
>
>---

>
>This message and any included attachments are from Siemens Medical
>Solutions
>USA, Inc. and are intended only for the addressee(s).
>The information contained herein may include trade secrets or
privileged or
>otherwise confidential information.  Unauthorized review, forwarding,
>printing,
>copying, distributing, or using such information is strictly prohibited
and
>may
>be unlawful.  If you received this message in error, or have reason to
>believe
>you are not authorized to receive it, please promptly delete this
message
>and
>notify the sender by e-mail with a copy to
>[EMAIL PROTECTED]
>
>Thank you
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: New logging method

2004-09-03 Thread Shapira, Yoav

Hi,
I don't use the XML configuration ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 03, 2004 9:10 AM
>To: 'Log4J Users List'
>Subject: RE: New logging method
>
>Yoav,
>
>Just out of curiosity, do you know how to specify it in the XML
>configuration file?  We don't use the properties configuration.
>
>Thanks again!
>
>--
>Sloan
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 03, 2004 9:07 AM
>To: Log4J Users List
>Subject: RE: New logging method
>
>
>
>Hi,
>You specify the ObjectRenderer in the configuration file, as
>log4j.renderer.fully.qualified.name.of.rendered.class=fully.qualified.n
a
>me.of.rendering.class.  See the PropertyConfigurator class JavaDoc for
a
>bit
>more details.
>
>The Map would get passed using the normal logging calls, e.g. Map stuff
=
>new HashMap(); stuff.put("principal", myPrincipal);
stuff.put("subject",
>mySubject); stuff.put("message", myMessage); logger.info(stuff);
>
>Cases like these are one of the main reasons methods like
>logger.info/warn/debug/error/fatal take Object and not String.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>>Sent: Friday, September 03, 2004 8:57 AM
>>To: 'Log4J Users List'
>>Subject: RE: New logging method
>>
>>Yoav,
>>
>>How would the map get passed and where do I specify the ObjectRenderer
>to
>>use?
>>
>>Do you know of an example?
>>
>>Thanks!
>>
>>--
>>Sloan
>>
>>-Original Message-
>>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>>Sent: Friday, September 03, 2004 8:54 AM
>>To: Log4J Users List
>>Subject: RE: New logging method
>>
>>
>>
>>Hi,
>>You could use a normal JDBCLogger, pass it a Map (or other Collection
>of
>>your choice) that contains the subject, principal, and a message, and
>write
>>an ObjectRenderer that can render those classes.  That way you don't
>need a
>>custom logger or a custom appender.
>>
>>Yoav Shapira
>>Millennium Research Informatics
>>
>>
>>>-Original Message-
>>>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>>>Sent: Friday, September 03, 2004 8:13 AM
>>>To: '[EMAIL PROTECTED]'
>>>Subject: New logging method
>>>
>>>I'm trying to figure out the best way to implement an audit system
for
>>my
>>>companies apps and I was thinking about using Log4j's framework but
>I'm
>>not
>>>sure of the best way of doing it.
>>>
>>>I need to be able to do something like:
>>>log.audit(javax.security.auth.Subject subject, Class principalClass,
>>String
>>>msg);
>>>
>>>So I was thinking I would have to create my own Logger, such as:
>>>AuditLogger log  = AuditLogger.getLogger(classname);
>>>
>>>And then use the JDBC Appender to write the audit information to the
>>>database.
>>>
>>>Now, I figure I have to create a new new patternlayout character
(such
>>as
>>>%s
>>>for subject) so that I can use all the different appenders easily...
>>>
>>>But I'm curious about the best way to get the log.audit() to work
with
>>the
>>>existing framework.
>>>
>>>Can anyone point me in the right direction?  Should I do it this way
>or
>>do
>>>something like:
>>>log.setSubject();
>>>log.setPrincipalClass();
>>>log.debug(msg); // have different audit levels...
>>>
>>>Thanks!
>>>--
>>>Sloan
>>>
>>
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary and/or privileged.  This e-mail is intended only for the
>>individual(s)
>to
>>whom it is addressed, and may not be saved, copied, printed, disclosed
>or
>>used by anyone else.  If you are not the(an) intended recipient,
please
>>immediately delete this e-mail from your computer system and notify
the
>>sender.  Thank you.
>>
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>This e-mail, including any att

RE: New logging method

2004-09-03 Thread Shapira, Yoav

Hi,
By the way, I'm just suggesting this approach as an alternative with
less work compared to your original idea.  Your original design is also
fine and workable, but I like to suggest an alternative that will keep
you within the log4j framework.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Shapira, Yoav
>Sent: Friday, September 03, 2004 9:07 AM
>To: Log4J Users List
>Subject: RE: New logging method
>
>
>Hi,
>You specify the ObjectRenderer in the configuration file, as
>log4j.renderer.fully.qualified.name.of.rendered.class=fully.qualified.n
a
>me.of.rendering.class.  See the PropertyConfigurator class JavaDoc for
a
>bit more details.
>
>The Map would get passed using the normal logging calls, e.g.
>Map stuff = new HashMap();
>stuff.put("principal", myPrincipal);
>stuff.put("subject", mySubject);
>stuff.put("message", myMessage);
>logger.info(stuff);
>
>Cases like these are one of the main reasons methods like
>logger.info/warn/debug/error/fatal take Object and not String.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>>Sent: Friday, September 03, 2004 8:57 AM
>>To: 'Log4J Users List'
>>Subject: RE: New logging method
>>
>>Yoav,
>>
>>How would the map get passed and where do I specify the ObjectRenderer
>to
>>use?
>>
>>Do you know of an example?
>>
>>Thanks!
>>
>>--
>>Sloan
>>
>>-Original Message-
>>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>>Sent: Friday, September 03, 2004 8:54 AM
>>To: Log4J Users List
>>Subject: RE: New logging method
>>
>>
>>
>>Hi,
>>You could use a normal JDBCLogger, pass it a Map (or other Collection
>of
>>your choice) that contains the subject, principal, and a message, and
>write
>>an ObjectRenderer that can render those classes.  That way you don't
>need a
>>custom logger or a custom appender.
>>
>>Yoav Shapira
>>Millennium Research Informatics
>>
>>
>>>-Original Message-
>>>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>>>Sent: Friday, September 03, 2004 8:13 AM
>>>To: '[EMAIL PROTECTED]'
>>>Subject: New logging method
>>>
>>>I'm trying to figure out the best way to implement an audit system
for
>>my
>>>companies apps and I was thinking about using Log4j's framework but
>I'm
>>not
>>>sure of the best way of doing it.
>>>
>>>I need to be able to do something like:
>>>log.audit(javax.security.auth.Subject subject, Class principalClass,
>>String
>>>msg);
>>>
>>>So I was thinking I would have to create my own Logger, such as:
>>>AuditLogger log  = AuditLogger.getLogger(classname);
>>>
>>>And then use the JDBC Appender to write the audit information to the
>>>database.
>>>
>>>Now, I figure I have to create a new new patternlayout character
(such
>>as
>>>%s
>>>for subject) so that I can use all the different appenders easily...
>>>
>>>But I'm curious about the best way to get the log.audit() to work
with
>>the
>>>existing framework.
>>>
>>>Can anyone point me in the right direction?  Should I do it this way
>or
>>do
>>>something like:
>>>log.setSubject();
>>>log.setPrincipalClass();
>>>log.debug(msg); // have different audit levels...
>>>
>>>Thanks!
>>>--
>>>Sloan
>>>
>>
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary
>>and/or privileged.  This e-mail is intended only for the individual(s)
>to
>>whom it is addressed, and may not be saved, copied, printed, disclosed
>or
>>used by anyone else.  If you are not the(an) intended recipient,
please
>>immediately delete this e-mail from your computer system and notify
the
>>sender.  Thank you.
>>
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
&g

RE: New logging method

2004-09-03 Thread Shapira, Yoav

Hi,
You specify the ObjectRenderer in the configuration file, as
log4j.renderer.fully.qualified.name.of.rendered.class=fully.qualified.na
me.of.rendering.class.  See the PropertyConfigurator class JavaDoc for a
bit more details.

The Map would get passed using the normal logging calls, e.g.
Map stuff = new HashMap();
stuff.put("principal", myPrincipal);
stuff.put("subject", mySubject);
stuff.put("message", myMessage);
logger.info(stuff);

Cases like these are one of the main reasons methods like
logger.info/warn/debug/error/fatal take Object and not String.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 03, 2004 8:57 AM
>To: 'Log4J Users List'
>Subject: RE: New logging method
>
>Yoav,
>
>How would the map get passed and where do I specify the ObjectRenderer
to
>use?
>
>Do you know of an example?
>
>Thanks!
>
>--
>Sloan
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 03, 2004 8:54 AM
>To: Log4J Users List
>Subject: RE: New logging method
>
>
>
>Hi,
>You could use a normal JDBCLogger, pass it a Map (or other Collection
of
>your choice) that contains the subject, principal, and a message, and
write
>an ObjectRenderer that can render those classes.  That way you don't
need a
>custom logger or a custom appender.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>>Sent: Friday, September 03, 2004 8:13 AM
>>To: '[EMAIL PROTECTED]'
>>Subject: New logging method
>>
>>I'm trying to figure out the best way to implement an audit system for
>my
>>companies apps and I was thinking about using Log4j's framework but
I'm
>not
>>sure of the best way of doing it.
>>
>>I need to be able to do something like:
>>log.audit(javax.security.auth.Subject subject, Class principalClass,
>String
>>msg);
>>
>>So I was thinking I would have to create my own Logger, such as:
>>AuditLogger log  = AuditLogger.getLogger(classname);
>>
>>And then use the JDBC Appender to write the audit information to the
>>database.
>>
>>Now, I figure I have to create a new new patternlayout character (such
>as
>>%s
>>for subject) so that I can use all the different appenders easily...
>>
>>But I'm curious about the best way to get the log.audit() to work with
>the
>>existing framework.
>>
>>Can anyone point me in the right direction?  Should I do it this way
or
>do
>>something like:
>>log.setSubject();
>>log.setPrincipalClass();
>>log.debug(msg); // have different audit levels...
>>
>>Thanks!
>>--
>>Sloan
>>
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary
>and/or privileged.  This e-mail is intended only for the individual(s)
to
>whom it is addressed, and may not be saved, copied, printed, disclosed
or
>used by anyone else.  If you are not the(an) intended recipient, please
>immediately delete this e-mail from your computer system and notify the
>sender.  Thank you.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: New logging method

2004-09-03 Thread Shapira, Yoav

Hi,
You could use a normal JDBCLogger, pass it a Map (or other Collection of
your choice) that contains the subject, principal, and a message, and
write an ObjectRenderer that can render those classes.  That way you
don't need a custom logger or a custom appender.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 03, 2004 8:13 AM
>To: '[EMAIL PROTECTED]'
>Subject: New logging method
>
>I'm trying to figure out the best way to implement an audit system for
my
>companies apps and I was thinking about using Log4j's framework but I'm
not
>sure of the best way of doing it.
>
>I need to be able to do something like:
>log.audit(javax.security.auth.Subject subject, Class principalClass,
String
>msg);
>
>So I was thinking I would have to create my own Logger, such as:
>AuditLogger log  = AuditLogger.getLogger(classname);
>
>And then use the JDBC Appender to write the audit information to the
>database.
>
>Now, I figure I have to create a new new patternlayout character (such
as
>%s
>for subject) so that I can use all the different appenders easily...
>
>But I'm curious about the best way to get the log.audit() to work with
the
>existing framework.
>
>Can anyone point me in the right direction?  Should I do it this way or
do
>something like:
>log.setSubject();
>log.setPrincipalClass();
>log.debug(msg); // have different audit levels...
>
>Thanks!
>--
>Sloan
>




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: maintaining the Frequently Asked Questions

2004-08-31 Thread Shapira, Yoav

Hi,
You need to login (to wiki) in order to edit these pages.  They're
immutable to anonymous users.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Jim Moore [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 31, 2004 8:56 AM
>To: Log4J Users List
>Subject: maintaining the Frequently Asked Questions
>
>The FAQ at http://logging.apache.org/log4j/docs/FAQ.html is read-only.
>
>The Wiki page at
>http://wiki.apache.org/logging-log4j/FrequentlyAskedQuestions is also
>read-only.  (An immutable wiki page???)  It teases people, though,
>saying that it can be edited  by going to nagoya
>(http://nagoya.apache.org/wiki/apachewiki.cgi?action=edit&id=Log4JProje
ctPa
>ges/FrequentlyAskedQuestions)
>but even though that takes you to an edit screen, it doesn't let you
>save.
>
>Is there any way for users to help maintain the FAQ for log4j?
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Class loading issues using WLS 8.1?

2004-08-26 Thread Shapira, Yoav

Hola,
I bet your hunch is correct.  You'd need to either ask the weblogic
folks how to isolate the startup classloader from the EAR classloaders,
or alternatively use explicit LoggerRepositories in your log4j
configuration within your EARs.  Check our Jake Kjome's
JNDIRepositorySelector (or a similar name) in the log4j-sandbox servlet
package.  (You can see it first at cvs.apache.org).

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: White, Joshua A (HTSC, CASD) [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 26, 2004 10:26 AM
>To: '[EMAIL PROTECTED]'
>Subject: Class loading issues using WLS 8.1?
>
>All,
>
>I have several wars/ears running on a single instance of WLS 8.1  Each
of
>these applications has its own log4j jar file and log4j configuration
file.
>All of them work as expected.  Recently,  I had the need to configure a
>weblogic startup class that also requires log4j.  I needed to put the
>startup class and log4j on the system/weblogic classpath.
>
>Once the WLS is started, I no longer receive logging messages for any
other
>app installed on the server.  This behavior seems to suggest that the
log4j
>jar that has been loaded on the system classpath is taking precedence
over
>the different instances that should be loaded and by the different
class
>loaders (war/ear).
>
>Any idea how to fix this problem?
>
>Regards,
>
>Joshua White
>
>
>This communication, including attachments, is for the exclusive use of
>addressee and may contain proprietary, confidential or privileged
>information. If you are not the intended recipient, any use, copying,
>disclosure, dissemination or distribution is strictly prohibited. If
>you are not the intended recipient, please notify the sender
>immediately by return email and delete this communication and destroy
all
>copies.




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: catching System.out and System.err into log4j

2004-08-25 Thread Shapira, Yoav

Hola,
That's a fine generic way.  If you want to take advantage of log4j options,
you can create a WriterAppender that writes to the same PrintStream (ps) in Michal's 
code below.  Then your loggers can write to this appender and they don't need to know 
of the fdout part.

If you're on unix, there's also the classic 2&1-style redirection commands. These have 
nothing to do with log4j per-se.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Michal Ziv [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 25, 2004 8:38 AM
>To: Log4J Users List
>Subject: Re: catching System.out and System.err into log4j
>
>hi,
>I simply use this:
> FileOutputStream fdout = new FileOutputStream(path/to/log/file);
> BufferedOutputStream bos = new BufferedOutputStream(fdout, 128);
> PrintStream ps = new PrintStream(bos, true);
> System.setOut(ps);
>and the same err
>   System.setErr(ps);
>hope it helps
>michal
>
>On Wednesday 25 August 2004 14:42, Ionel GARDAIS wrote:
>>Hi there,
>>
>>Someone else askes this but I did not saw any
>>response.
>>
>>Is it possible to seemlessly catch System.out and
>>System.err and redirect to log4j ?
>>
>>thanks,
>>ionel
>>
>>
>>
>>
>>
>>
>>Vous manquez d'espace pour stocker vos mails ?
>>Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
>>Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>>
>>Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés
>> pour dialoguer instantanément avec vos amis. A télécharger gratuitement
>sur
>> http://fr.messenger.yahoo.com
>>
>>-
>>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: need the latest jar..

2004-08-18 Thread Shapira, Yoav

Hi,
No problem.  See http://www.apache.org/dev/contributors.html#cvsbasics
for CVS guidelines.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Amit Nigam [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 18, 2004 10:23 AM
>To: 'Log4J Users List'
>Subject: RE: need the latest jar..
>
>thanx for the info Yoav. But do u mean that i need to get the source
code
>from http://logging.apache.org/log4j/ site? can u tell me the steps
>involved
>in downloading CVS head?
>sorry but i m new to it. thanx for ur help.
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 18, 2004 6:20 PM
>To: Log4J Users List
>Subject: RE: need the latest jar..
>
>
>
>Hi,
>Two options: download CVS HEAD and build it yourself (it compiles
>without a problem, I just did it last night).  Or use the Gump
>nightlies, http://brutus.apache.org/gump/public/buildLog.html.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Amit Nigam [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, August 18, 2004 2:18 AM
>>To: '[EMAIL PROTECTED]'
>>Subject: need the latest jar..
>>
>>Hi,
>>
>>  i would like to know from where can i get an
>>alpha version of log4j1.3 jar?
>>
>>Thanks & Regards,
>>Amit Nigam
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary
>and/or privileged.  This e-mail is intended only for the individual(s)
to
>whom it is addressed, and may not be saved, copied, printed, disclosed
or
>used by anyone else.  If you are not the(an) intended recipient, please
>immediately delete this e-mail from your computer system and notify the
>sender.  Thank you.
>
>
>-
>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: need the latest jar..

2004-08-18 Thread Shapira, Yoav

Hi,
Two options: download CVS HEAD and build it yourself (it compiles
without a problem, I just did it last night).  Or use the Gump
nightlies, http://brutus.apache.org/gump/public/buildLog.html.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Amit Nigam [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 18, 2004 2:18 AM
>To: '[EMAIL PROTECTED]'
>Subject: need the latest jar..
>
>Hi,
>
>  i would like to know from where can i get an
>alpha version of log4j1.3 jar?
>
>Thanks & Regards,
>Amit Nigam
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: generating log4j.xml

2004-08-18 Thread Shapira, Yoav

Hi,
I'm not that gung-ho about configuration-file-generation tools.  We've
had some bitter experiences in the Tomcat area related to this.  The
problem is that the code tends to develop faster than the
configuration-file-generation tool and so the configuration file
generator outputs either incomplete or invalid configuration files (at
worst), or just doesn't expose all the functionality of the code (which
is not that bad a scenario).

If someone wants to develop and maintain it, good for them.  I'm not
sure it belongs in the log4j core, at least initially.  If it stands the
test of tiem (as a contrib module perhaps, or a sandbox one), and gets
significant usage, then maybe.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Paul Smith [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 17, 2004 11:42 PM
>To: 'Log4J Users List'
>Subject: RE: generating log4j.xml
>
>> I'd be glad to volunteer as I need it for the project I'm working on.
>> My concern is that any xml generator would become obsolete with log4j
>> 1.3. From the docs, I see that 1.3 xml configuration is achieved
using
>> something called the joran configurator
>> http://www.qos.ch/logging/JoranConfigurator.html
>>
>> would it make more sense to develop something like a
JoranConfigWriter?
>
>Well, you could call it that, but the reading and configuring is done
by
>JoranConfigurator, but one could think that once a LoggerRepository is
>configured, it's configuration could be output in any form (properties,
>XML,
>whatever).  If we have a class that walks the LoggerRepository loggers,
>appenders, and plugins, and outputs the configuration file in some
format
>(obviously XML in the format JoranConfigurator can read would be the
most
>useful first version) that would be perfect.
>It should be straightforward from a Junit point of view too.  Given an
XML
>configuration file, use JoranConfigurator to configure, then use
>NathansCoolConfigWriter to write the xml file back out, and then
compare
>the
>2 xml files together for success/failure.
>
>> I know this has probably been asked a thousand times how far off
is
>> 1.3?  a week, a month, a year?
>echo "how far off is 1.3?" > /dev/idontknow/
>cheers,
>Paul Smith
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Configuring Log4J

2004-08-18 Thread Shapira, Yoav

Hi,
There is documentation on these configuration parameters.  It's in the
Short Manual, the JavaDoc for the PropertyConfigurator class, the FAQ
(http://logging.apache.org/log4j/docs/faq.html), and Ceki's complete
log4j manual (a non-free book that's well worth the purchase according
to several opinions I've heard).

The one key piece of configuration for property files is this: they
follow the JavaBean notation.  With that and the Log4j API JavaDoc,
you're all set.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 17, 2004 4:36 PM
>To: Log4J Users List
>Subject: Re: Configuring Log4J
>
>Speaking of which, how come there are no documentation on the
>configuration parameters... Or is it me who can't find it?
>
>Thanks,
>-ramin
>
>
>
>
>
>
>"Harshawardhan Gadgil" <[EMAIL PROTECTED]>
>08/17/2004 04:34 PM
>Please respond to "Log4J Users List"
>
>
>To: "Log4J Users List" <[EMAIL PROTECTED]>
>cc:
>Subject:Re: Configuring Log4J
>
>
>PHEW...
>Got it
>
>log4j.category.org.apache.axis=OFF
>
>did the trick...
>
>
>On Tue, 2004-08-17 at 11:00, Harshawardhan Gadgil wrote:
>> Hi,
>> I'm a new user to Log4J and I've a configuration question.
>>
>> I'm using Log4J in my programs to o/p all sorts of stuff from DEBUG
to
>> FATAL.. Also I make use of Apache AXIS in some places..
>>
>> using
>> log4j.debug=true
>> OR
>> log4j.rootLogger=DEBUG, MYSTUFF
>>
>> causes the Axis's DEBUG level stuff to be printed out as well
>>
>> Is there a way to only allow my logging and disable AXIS's logging
>>
>> Only way I could get it to work is by doing
>> log4j.rootLogger=INFO, MYSTUFF
>>
>> but then it does not print out my debug statements either...
>>
>> I tried the following too
>> org.apache.axis=false
>>
>> AND
>> log4j.additivity.org.apache.axis=false
>> but w/ no result
>>
>> Any help in this matter is highly appreciated.
>>
>> Thanks,
>--
>Harshawardhan S. Gadgil  [http://www.cs.indiana.edu/~hgadgil]
>Community Grids Lab, Bloomington, IN  [(812)856-0756]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Is there a "MQAppender"...

2004-08-16 Thread Shapira, Yoav
Hi,
The other post had a couple of good ideas.  The probability of us
including a provider-specific appender implementation is in the log4j
core is slim.  In add-on/contrib modules, the probability is higher, but
you'd have to write it, submit it to us (with the appropriate copyright
transfer), and probably agree to be the contact address for maintenance
on that contributed code.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: McCarty, Brian [mailto:[EMAIL PROTECTED]
>Sent: Friday, August 13, 2004 10:15 PM
>To: [EMAIL PROTECTED]
>Subject: Is there a "MQAppender"...
>
>I have looked at the JMSAppender and have used it with success;
however,
>I am curious if someone has written or attempted to written an appender
>that uses WebSphere MQ solely.  The reason I ask is that we are heavily
>invested in MQ via multiple operating systems and languages.  Having an
>appender that sends out MQ formatted messages rather than only JMS ones
>would allow non Java applications to be able to dequeue the messages at
>there final destination.
>
>In addition, if there were a port for log4cc that sent out the same
>formatted messages, the dequeue application would not have to change.
>
>I looked at the source code for JMSAppender, and it seems as long as I
>don't send the payloads as serialized objects and make a format
>required, it should be fairly simple.  I would appreciate any comments
>or suggestions.
>
>Thanks in advance,
>
>Brian M. McCarty
>I/T Lead Programmer
>210.913.1678
>WMQ(I) Specialist/Solutions Expert
>e-business Solution Advisor/Designer/Technologist


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



RE: How do I turn off console logging...

2004-08-12 Thread Shapira, Yoav
Hi,
How are you configure log4j?  If you're calling
BasicConfigurator.configure(), that adds a console appender.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Sean Casey [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 12, 2004 12:43 PM
>To: [EMAIL PROTECTED]
>Subject: How do I turn off console logging...
>
>Hi,
>
>I am new to log4j, so forgive my possibly stupid question.  I want to
have
>my application log to a daily rotating file only, i.e. I don't want
>anything to come to the console, AND I don't want every log message
logged
>twice.  I have defined a named logger, and have set its appender to be
a
>DailyRollingFileAppender, but I can't figure out how to silence the
>rootLogger, nor can I get the additivity to work, so that I don't get
>duplicate entries.  Can anyone help me?
>
>Thanks,
>
>Sean
>
>
>-
>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: Nightly-builds?

2004-08-11 Thread Shapira, Yoav
Hi,
I don't know if they were ever at http://cvs.apache.org/builds/, but
they're not there now.  Gump builds log4j but a new Gump run on Brutus
was just started so I can't tell the location yet.  Check
http://brutus.apache.org/gump/public/buildLog.html in a couple of hours.
I know it builds (or tries to) both log4j 1.2 and log4j from CVS HEAD,
and provides links to them.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Gary Gregory [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 10, 2004 5:37 PM
>To: [EMAIL PROTECTED]
>Subject: Nightly-builds?
>
>Hello,
>
>Where are the log4j nightly builds?
>
>Thanks,
>Gary
>
>-
>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 SEVERE ThreadDeath in Tomcat 5.0.25

2004-08-05 Thread Shapira, Yoav

Hi,
Creating each developer a separate instance is pretty much the only way to go.  That's 
not just true for tomcat, but in general.  The alternative always leads to instability 
and worse in my experience.  So I'm glad you've done that now.

As for helping further: you nailed it on the head when you say "I wish I could put 
together a use case for you" -- that would be ideal.  Bugzilla items without a 
reproducible test case tend to receive the least attention and time.  That's not to 
say the bug doesn't exit.  It's just a reflection of the fact we (I have my Tomcat 
Developer hat on when writing this message) have a ton of work and very little spare 
bandwidth.

One thing I'll tell you right now, and it's good: the classloaders and application 
deployers (including hot swap and runtime restarting of applications) are receiving a 
thorough refactoring/redesign/re-evaluation for Tomcat 5.1.  It's the major item Remy 
has been working on for a month now, with the objective of coming up with far simpler 
and far more robust and consistent mechanism.  So there's hope ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 05, 2004 9:28 AM
>To: Log4J Users List
>Cc: [EMAIL PROTECTED]
>Subject: RE: log4j SEVERE ThreadDeath in Tomcat 5.0.25
>
>Excellent :) I have tried everything in the bugs that relate to this
>issue..
>
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26372
>http://issues.apache.org/bugzilla/show_bug.cgi?id=27371
>
>but it's still occurring. I wish I could put together a use case for you
>but the error is so sporadic. One day we can compile the whole day without
>a problem, the next 1 developer gets the ThreadDeath every time he compiles
>and some days all developers are getting it.
>
>i ended up creating each developer a separate tomcat development instance
>but each developer is getting the problem at different times.
>
>please let me know if I can be of further help in debugging this for you
>
>Cheers, Allistair.
>
>
>> -Original Message-
>> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>> Sent: 05 August 2004 14:17
>> To: Log4J Users List
>> Subject: RE: log4j SEVERE ThreadDeath in Tomcat 5.0.25
>>
>>
>>
>> Hi,
>> I see what you mean.  The relevant Tomcat code is being
>> significantly refactored at the moment for Tomcat 5.1, but
>> I'll try to look through the current version to see if the
>> started/ThreadDeath logic is changed.  I also added
>> [EMAIL PROTECTED] as a CC on this bug item, but
>> I've yet to change the Component of the bug to Tomcat.  Stay tuned...
>>
>> Yoav Shapira
>> Millennium Research Informatics
>>
>>
>> >-Original Message-
>> >From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>> >Sent: Thursday, August 05, 2004 8:55 AM
>> >To: Log4J Users List
>> >Subject: Re: log4j SEVERE ThreadDeath in Tomcat 5.0.25
>> >
>> >
>> >As far as I can tell, this bug is more of a Tomcat issue
>> than log4j and
>> >unrelated to the well-known configureAndWatch bug in log4j.
>> >
>> >See bug 27371
>> >http://issues.apache.org/bugzilla/show_bug.cgi?id=27371
>> >
>> >In particular, see comments by Claudio Corsi dated 2nd of
>> August 2004.
>> >
>> >I hope this helps.
>> >
>> >
>> >
>> >At 11:31 AM 8/5/2004, Allistair Crossley wrote:
>> >>We are experiencing Tomcat failure as soon as the following
>> exception gets
>> >>thrown;
>> >>
>> >>SEVERE: Exception invoking periodic operation:
>> >>java.lang.ThreadDeath
>> >> at
>> >>
>> >org.apache.catalina.loader.WebappClassLoader.loadClass(Webapp
>> ClassLoader.ja
>> >va:1229)
>> >> at
>> >>
>> >org.apache.catalina.loader.WebappClassLoader.loadClass(Webapp
>> ClassLoader.ja
>> >va:1189)
>> >> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> >> at
>> >org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:241)
>> >> at org.apache.log4j.Category.forcedLog(Category.java:431)
>> >> at org.apache.log4j.Category.log(Category.java:966)
>> >> at
>> >>
>> org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.
>> java:195)
>> >> at
>> >>
>> >org.apache.catalina.session.StandardManager.start(StandardMan
>&g

RE: log4j SEVERE ThreadDeath in Tomcat 5.0.25

2004-08-05 Thread Shapira, Yoav

Hi,
And also don't use configureAndWatch, as that creates the monitoring
thread that's likely causing this exception.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Shapira, Yoav
>Sent: Thursday, August 05, 2004 8:34 AM
>To: Log4J Users List
>Subject: RE: log4j SEVERE ThreadDeath in Tomcat 5.0.25
>
>
>Hi,
>Make sure you have a ServletContextListener that does
>LogManager.shutdown() in its contextDestroyed method.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, August 05, 2004 5:32 AM
>>To: Log4J Users List
>>Subject: log4j SEVERE ThreadDeath in Tomcat 5.0.25
>>
>>We are experiencing Tomcat failure as soon as the following exception
>gets
>>thrown;
>>
>>SEVERE: Exception invoking periodic operation:
>>java.lang.ThreadDeath
>>  at
>>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
e
>r.ja
>>va:1229)
>>  at
>>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoad
e
>r.ja
>>va:1189)
>>  at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>  at
>org.apache.log4j.spi.LoggingEvent.(LoggingEvent.java:241)
>>  at org.apache.log4j.Category.forcedLog(Category.java:431)
>>  at org.apache.log4j.Category.log(Category.java:966)
>>  at
>>org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:195
)
>>  at
>>org.apache.catalina.session.StandardManager.start(StandardManager.java
:
>659)
>>  at
>>org.apache.catalina.core.StandardContext.start(StandardContext.java:42
7
>2)
>>  at
>>org.apache.catalina.core.StandardContext.reload(StandardContext.java:3
0
>21)
>>  at
>>org.apache.catalina.core.StandardContext.backgroundProcess(StandardCon
t
>ext.
>>java:4629)
>>  at
>>org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
o
>cess
>>Children(ContainerBase.java:1619)
>>  at
>>org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
o
>cess
>>Children(ContainerBase.java:1628)
>>  at
>>org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.pr
o
>cess
>>Children(ContainerBase.java:1628)
>>  at
>>org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.ru
n
>(Con
>>tainerBase.java:1608)
>>  at java.lang.Thread.run(Unknown Source)
>>
>>This exception we have discovered mostly occurs after a developer
>compiles
>>classes to Tomcat which makes Tomcat restart the context. Mostly,
>because
>>sometimes it is fine. We cannot establish a concrete pattern of
>behaviour
>>except that some compiles of any class type that make TC reload the
>webapp
>>cause this unercoverable error.
>>
>>This has happened with log4j1.2.8 and 1.3alpha0
>>
>>Cheers, ADC
>>
>>
>>
>>---
>>QAS Ltd.
>>Developers of QuickAddress Software
>>http://www.qas.com";>www.qas.com
>>Registered in England: No 2582055
>>Registered in Australia: No 082 851 474
>>---
>>
>>
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
intended
>recipient, please immediately delete this e-mail from your computer
system
>and notify the sender.  Thank you.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Logging Strategy

2004-08-04 Thread Shapira, Yoav

Hi,
Be careful deciding on strategy based on fears alone, rather than actual
experimentation or benchmarking, especially with a tool that's new to
you such as log4j.  We use Loggers that are named the same as their
class, so we have one Logger per class.  We have thousands of classes at
runtime in the JVM and it works fine, but then again our apps are
memory-hungry to the point where log4j is not a significant memory usage
factor.  We've found this configuration to be priceless, because
although you can make the case that a package is a functional unit and
not a class, logging from an entire package can become very verbose very
quickly.


Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Edward Howe [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, August 04, 2004 10:33 AM
>To: 'Log4J Users List'
>Subject: RE: Logging Strategy
>
>I am currently developing such a strategy while introducing log4j to an
>existing web-based application.  Not having experience with log4j, this
>thread is timely.
>
>My tenative plan is to use package-level loggers.  So for each class in
>package com.foo.bar, I would have:
>  private static final Logger LOG = Logger.getLogger("com.foo.bar");
>
>My reasoning is that packages generally correspond to functional areas
in
>our app, and would provide finer granularity than naming loggers by
>functional areas
>(http://logging.apache.org/log4j/docs/FAQ.html#namingLoggers).  I fear
that
>using class names would result in a huge number of loggers (and memory
>overhead), so package names seemed a reasonable compromise.  (We have
>5000
>classes vs. >350 packages.)
>
>Ed Howe
>
>
>-Original Message-
>From: Paul Smith [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 03, 2004 6:32 PM
>To: 'Log4J Users List'
>Subject: RE: Logging Strategy
>
>
>A Good Strategy is one that works for you, and a bad is one that
doesn't.
>But since people are different, a strategy may be good or bad depending
on
>who uses it.
>So I can only outline what strategy I usually follow, and maybe
encourage
>others to outline their own.  Maybe then we could take the results and
put
>them all in a Wiki page, with a discussion of advantages/disadvantages
of
>each.  Might be a useful resource.
>Anyway, here's what I do, for what it's worth.
>
>* For each class, declare a class level logger in the usual form:
>  private static final Logger LOG = Logger.getLogger(MyClass.class);
>
>  This logger is used mostly for DEBUG logging, logging method params,
low
>level information, maybe timing information etc.
>
>* If the Class in question forms part of logical sub-system of the
>application, I create an Subsystem logger as well, in the same class:
>
>  private static final Logger MYSUBSYSTEM_LOG =
>Logger.getLogger("myapplication.mysubsystem");
>
>I use this logger mostly for INFO/WARN/ERROR, because generally those
types
>of logs are Application related, rather than class specific, and it's
>generally more useful to aggregate those types of logs into the same
area.
>Occasionally, a specific log statement might be kind of both class and
>application related, and so in this case, I would log the message to
BOTH
>Loggers.  Somewhat duplicated, but sometimes when you are trying to
find
>out
>what is happening you might want to focus from an Application
perspective
>(so, a lot of classes spread by the way a thread would use it), or from
a
>package, or class perspective.  When you might need to do either at any
>point, it's useful to have that up your sleeve.
>This gives me the ability to have all application logs going where I
want,
>because I could just attach the appender to the 'myapplication' logger,
or
>I
>could route sub-system logs somewhere else, or both.
>When I need to focus on specific class activity, I can dynamically
attach
>an
>appender to a package logger, or to the class-specific logger, and
watch
>what is happening.
>The above approach, I think, is what will benefit from the new Domain
>concept Ceki is developing, but I'm not really that sure, I'll leave
Ceki
>to
>comment on that.
>What do other people do?
>Cheers,
>Paul Smith
>> -Original Message-
>> From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, August 04, 2004 1:04 AM
>> To: [EMAIL PROTECTED]
>> Subject: Logging Strategy
>>
>> Hi All,
>>
>> This question is more of a logging strategy question.
>>
>> I have architected our intranet using a Struts architecture which
uses
>> backend subsystems like SQL Server, Hibernate, Content Management
System
>> etc.. via J2EE BluePrint design patterns and so on.
>>
>> Because of the number of subsystems and applications within the
>> architecture, it is helpful to partition up these as different logs.
>>
>> At the moment I have such a mess of a log4j strategy and I would like
to
>> clean it up. Currently I have 2 strategies in place:
>>
>> 1) Some classes acquire a named logger, e.g
>> getLogger("TheNameOfAnAppender"). So an application called
HolidayForms
>> might on

RE: Commons Logging breaks with log4j.1.3 alpha -> Caused by: java.lang.NoSuchFieldError: DEBUG

2004-08-03 Thread Shapira, Yoav

Hi,
This is a CVS question.  I hope you have a good CVS GUI, but if not this
applies from the command line as well.

When you do a CVS checkout without specifying a branch or revision tag,
you get the HEAD copy which is the latest.  For log4j this is the latest
1.3 alpha code.  If you want 1.2.8, you need to specify its tag when
doing the CVS checkout.

Take a look at any log4j CVS file using your CVS GUI or Apache's ViewCVS
web front-end, e.g.
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4
j/BasicConfigurator.java

You would want to do a checkout using the PREALPHA_1_3_AS_OF_2004_05_12
tag and build from that.  That will get you the latest 1.2.8 hopefully
(to make sure you need to ask the person who tagged the repository
[which would be Ceki for this tag I believe] what the tag identifies).

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 03, 2004 7:31 AM
>To: Log4J Users List
>Subject: Commons Logging breaks with log4j.1.3 alpha -> Caused by:
>java.lang.NoSuchFieldError: DEBUG
>
>Well, I managed to get my CVS working and I checked out log4j and
compiled
>using Ant, and it ended up giving me jars for log4j1.3 alpha rather
than a
>fixed 1.2.8 update (as you know i am looking for a fix for
>dailyrollingfileappender).
>
>Anyway, I have tried to use 1.3 alpha and thought i would let you know
that
>Tomcat 5 bombs out with the same problem all my own logs had which is
>
>Caused by: java.lang.NoSuchFieldError: DEBUG
>
>How do I do a checkout and compile of the latest 1.2.8 stuff?
>
>Cheers, ADC.
>
>** End of LogManager static initializer
>Aug 3, 2004 12:26:09 PM org.apache.commons.modeler.Registry
>registerComponent
>SEVERE: Null component
>Catalina:type=JspMonitor,WebModule=//localhost/,J2EEApplication=none,J2
EESe
>rver=none
>Aug 3, 2004 12:26:09 PM org.apache.commons.digester.Digester endElement
>SEVERE: End event threw exception
>java.lang.reflect.InvocationTargetException
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at
>org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:
252)
>   at
org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
>   at org.apache.commons.digester.Rule.end(Rule.java:276)
>   at
>org.apache.commons.digester.Digester.endElement(Digester.java:1058)
>   at
>org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.j
ava:
>76)
>   at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
>Source)
>   at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Un
know
>n Source)
>   at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDi
spat
>cher.dispatch(Unknown Source)
>   at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkn
own
>Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
>   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
>   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
>   at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
>   at
>org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeplo
yer.
>java:488)
>   at
>org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
>   at
>org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.jav
a:48
>2)
>   at
>org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
>   at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:964)
>   at
>org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:3
49)
>   at
>org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
>rt.java:119)
>   at
>org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
>   at
org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
>   at
>org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
>   at
>org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
>   at
>org.apache.catalina.core.StandardService.start(StandardService.java:476
)
>   at
>org.apache.catalina.core.StandardServer.start(StandardServer.java:2298)
>   at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at
org.apache.catalina.startup.Boo

RE: jar for 1.2.8 cvs head?

2004-08-03 Thread Shapira, Yoav

Hi,
There's no such thing.  There's 1.2.8 and HEAD, and they're different.  You basically 
can't compile 1.2.8 from CVS HEAD as there's too much 1.3 stuff there.

I see in your other message that you've managed to get CVS to work, so I'll provide 
more details in response to that one.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, August 03, 2004 5:04 AM
>To: Log4J Users List
>Subject: jar for 1.2.8 cvs head?
>
>Does anyone happen to have a JAR of the latest log4j 1.2.8 that has been
>compiled from CVS HEAD so that I can use the fix for renameTo in the
>rolling file appender? We are losing so much logging because of this bug
>and I cannot access CVS as our firewall blocks it.
>
>Cheers, ADC
>
>
>> -Original Message-
>> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>> Sent: 03 August 2004 10:03
>> To: Log4J Users List
>> Subject: RE: Gzip rolled logs
>>
>>
>> At 11:42 PM 8/2/2004, you wrote:
>> > > Paul: It really already there! :-)
>> >*Paul quickly tries to dig hole to hide from his silliness*
>>
>> Only the passive and idle make no mistakes.
>>
>>
>> --
>> Ceki Gülcü
>>
>>   For log4j documentation consider "The complete log4j manual"
>>   ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>
>---
>QAS Ltd.
>Developers of QuickAddress Software
>http://www.qas.com";>www.qas.com
>Registered in England: No 2582055
>Registered in Australia: No 082 851 474
>---
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Gzip rolled logs

2004-08-02 Thread Shapira, Yoav

Hi,
You can get nightlies for log4j from Gump:
http://brutus.apache.org/gump/public/logging-log4j/logging-log4j/index.html

http://brutus.apache.org/gump/public/logging-log4j-12/logging-log4j-12/index.html.

You can also download and build yourself.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Allistair Crossley [mailto:[EMAIL PROTECTED]
>Sent: Monday, August 02, 2004 10:56 AM
>To: Log4J Users List
>Subject: RE: Gzip rolled logs
>
>Oh that's good news!
>
>What is the easiest way for non-CVS developers to get hold of this fix? I
>can only see 1 pre-compiled download for 1.2.8 which I have. Are nightly
>builds not available with new fixes like Tomcat etc..?
>
>Cheers, ADC.
>
>
>> -Original Message-
>> From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>> Sent: 02 August 2004 14:46
>> To: Log4J Users List
>> Subject: RE: Gzip rolled logs
>>
>>
>> At 11:47 AM 8/2/2004, you wrote:
>> >Will a bug fix be available for the renameTo fail of
>> RollingFileAppender
>> >running on Windows/Tomcat 5 variations in eitgher 1.2.8 or 1.3?
>>
>> Yes. There is already a fix for this in CVS head.
>>
>>
>> --
>> Ceki Gülcü
>>
>>   For log4j documentation consider "The complete log4j manual"
>>   ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>
>---
>QAS Ltd.
>Developers of QuickAddress Software
>http://www.qas.com";>www.qas.com
>Registered in England: No 2582055
>Registered in Australia: No 082 851 474
>---
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Failed to log message with log.error() !!!

2004-07-30 Thread Shapira, Yoav

Hi,
A couple of pointers:

>log4j.appender.A1.File=/WEB-INF/log/ejcourse.log

Do you really have a /WEB-INF off your root directory?  The above is an
absolute reference, not relative to anything, so it's probably wrong.

># A1 Categories
>log4j.category.com.echows=INFO,ERROR,DEBUG

You only specify the minimum category here, i.e. DEBUG for your case.
You would also specify an appender, such as A1.  So change to
log4j.logger.com.echows = A1, DEBUG

I suggest you revisit the PropertyConfigurator JavaDoc where more
examples on syntax can be found.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Release date for log4j 1.3?

2004-07-28 Thread Shapira, Yoav
Hi,
You can ask, of course, and I can only give the stock answer: there is
limited documentation at this time, little more than some JavaDocs.  As
the code nears stability and alpha releases come out, we will solidify
the documentation.  It's safe to assume that not only will the JavaDocs
be completed, but the Short Manual and its associated examples will be
revised and enhanced.

I've actually been itching to take a page from the PicoContainer book on
documentation, and do a "One Minute Description" "Two Minute Tutorial"
and then the Short Manual giving a more complete background and theory.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Lutz Michael [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 28, 2004 9:04 AM
>To: 'Log4J Users List'; Marano Howard
>Subject: RE: Release date for log4j 1.3?
>
>
>
>May I please ask one related question - is there any documentation
>associated with these features (especially logging domains) above and
>beyond
>the work plan list?
>Mike
>
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 27, 2004 1:25 PM
>To: Log4J Users List
>Subject: RE: Release date for log4j 1.3?
>
>
>
>Hola,
>If I had $1 for every time we saw this question ;)
>
>I think < 12 weeks for 1.3alpha0 is "sane" ;)
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: David J. M. Karlsen [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, July 27, 2004 1:09 PM
>>To: Log4J Users List
>>Subject: Release date for log4j 1.3?
>>
>>Thanks for a lovely product!
>>
>>I find a lot of the features announced for 1.3 very interesting. How
>>mature is log4j 1.3 currently - and do anybody have an opinion of a
>sane
>>release-date?
>>
>>
>>Kind regards,
>>
>>David Karlsen
>>
>>--
>>David J. M. Karlsen - +47 90 68 22 43
>>http://www.davidkarlsen.com
>>http://mp3.davidkarlsen.com
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary
>and/or privileged.  This e-mail is intended only for the individual(s)
to
>whom it is addressed, and may not be saved, copied, printed, disclosed
or
>used by anyone else.  If you are not the(an) intended recipient, please
>immediately delete this e-mail from your computer system and notify the
>sender.  Thank you.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---

>
>This message and any included attachments are from Siemens Medical
>Solutions
>USA, Inc. and are intended only for the addressee(s).
>The information contained herein may include trade secrets or
privileged or
>otherwise confidential information.  Unauthorized review, forwarding,
>printing,
>copying, distributing, or using such information is strictly prohibited
and
>may
>be unlawful.  If you received this message in error, or have reason to
>believe
>you are not authorized to receive it, please promptly delete this
message
>and
>notify the sender by e-mail with a copy to
>[EMAIL PROTECTED]
>
>Thank you
>
>-
>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: Release date for log4j 1.3?

2004-07-27 Thread Shapira, Yoav

Hola,
If I had $1 for every time we saw this question ;)

I think < 12 weeks for 1.3alpha0 is "sane" ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: David J. M. Karlsen [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 27, 2004 1:09 PM
>To: Log4J Users List
>Subject: Release date for log4j 1.3?
>
>Thanks for a lovely product!
>
>I find a lot of the features announced for 1.3 very interesting. How
>mature is log4j 1.3 currently - and do anybody have an opinion of a
sane
>release-date?
>
>
>Kind regards,
>
>David Karlsen
>
>--
>David J. M. Karlsen - +47 90 68 22 43
>http://www.davidkarlsen.com
>http://mp3.davidkarlsen.com
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Decorating output before RollingFileAppender

2004-07-27 Thread Shapira, Yoav

Hi,
You can always extend either RollingFileAppender or PatternLayout to
suit your own needs.  That's a big plus of open-source and our ASF
license ;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: F Kurzawa [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, July 27, 2004 12:37 PM
>To: Log4J Users List
>Subject: RE: Decorating output before RollingFileAppender
>
>Hi James,
>
>Sorry I wasn't clearer.
>
>I need to be able to decorate the output BEFORE RollingFileAppender.
This
>is
>because I need to have different lines laid out out differently
depending
>on
>which logger that they came from. I don't have enough control with the
>single
>PatternLayout within RFA to get the different formatting that I need.
>
>The intuitively obvious approach was to use multiple
RollingFileAppenders,
>each
>of which would write to the same file. But RollingFileAppender becomes
very
>confused if other RFA's are writing to the same file, and the file
starts
>getting rotated willy-nilly as each RFA steps on the other.
>
>So that approach won't work.
>
>Regards,
>
>Frank
>
>--- James Stauffer <[EMAIL PROTECTED]> wrote:
>
>> RollingFileAppender extends FileAppender so it takes a PatternLayout
>also.
>>
>> James Stauffer
>>
>>
>> -Original Message-
>> From: F Kurzawa [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, July 27, 2004 10:55 AM
>> To: Log4J Users List
>> Subject: Decorating output before RollingFileAppender
>>
>>
>> I want to format and modify my log4j output prior to sending to a
>> RollingFileAppender.
>>
>> If there were functionality that would allow me to easily apply a
>> PatternLayout prior to sending to a RollingFileAppender that would be
>ideal.
>>
>> I can insert an AsyncAppender before my RollingFileAppender, but
>> AsyncAppender does not take a PatternLayout parameter so it doesn't
help.
>>
>> In fact, the only two appenders that take PatternLayout arguments are
the
>> *FileAppender's and ConsoleAppender.
>>
>> Is there a simple way to decorate my output with a PatternLayout (or
some
>> similar functionality) prior to its arrival in a RollingFileAppender?
>>
>> Thanks in advance,
>>
>> Frank
>>
>>
>>
>> __
>> Do you Yahoo!?
>> Yahoo! Mail - 50x more storage than other providers!
>> http://promotions.yahoo.com/new_mail
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
>
>
>__
>Do you Yahoo!?
>New and Improved Yahoo! Mail - Send 10MB messages!
>http://promotions.yahoo.com/new_mail
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: JDK compatibility

2004-07-23 Thread Shapira, Yoav
Hi,
Do you remember the specific conflict or error?  I'm very surprised to hear of this 
between 1.2.5 and 1.2.8 as there were no class hierarchy or interface changes that I'm 
aware of.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 23, 2004 9:38 AM
>To: [EMAIL PROTECTED]
>Subject: AW: JDK compatibility
>
>We had a similiar problem, when someone unintentionally deployed a newer
>version of log4j  (1.2.8, but we are still on 1.2.5) as a jar file in the
>lib directory of a webapplication. Depending on which application was
>called first (and thus initialized our environment) sometimes the newer
>log4j classes and interfaces where loaded first. When (after that) another
>application tried to log, the (older versioned) logger in it's class path
>couldn't be instantiated because of a version conflict with the already
>loaded interfaces of the newer log4j version.
>
>
>-Ursprüngliche Nachricht-
>Von: Lutz Michael [mailto:[EMAIL PROTECTED]
>Gesendet: Donnerstag, 22. Juli 2004 21:22
>An: 'Log4J Users List'
>Betreff: RE: JDK compatibility
>
>
>
>
>Yoav, thank you very much (as always) for your response.
>
>Unfortunately because of the nature of the error (and possibly because of
>the implementation of the MS JVM) we are not getting a stack trace
>pinpointing the problem.  The end of the stack trace is vague.
>
>Most of our application runs on a different VM, so because we wrapped Log4j
>we are going to just substitute a "dumb" file logger for now when we're
>running under J++, this has been deemed an acceptable work-around.  So for
>now we're OK.
>
>If we get a better stack trace I'll follow up with the information.
>
>Regards,
>Mike
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 21, 2004 2:39 PM
>To: Log4J Users List
>Subject: RE: JDK compatibility
>
>
>Hi,
>The Visual J++ JVM is 1.1-compatible supposedly, but it's different from
>Sun's 1.1.  Can you run OK on Sun 1.1?  What's the full stack trace for
>the NoClassDefFoundError?
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Lutz Michael [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, July 21, 2004 2:29 PM
>>To: Log4J Users List; Anderson Ian
>>Subject: JDK compatibility
>>
>>
>>
>>We're experiencing problems with Log4j running on J++, JDK 1.1.4.  We
>found
>>on the FAQ that Log4j is 1.1.x compatible.
>>
>>Specifically, a NoClassDefFound error is being generated.  Does anyone
>have
>>any ideas on a work-around, or are we doing something wrong?  Can we
>run
>>Log4j on Visual J++?
>>
>>Thanks in advance.
>>Mike
>>
>>___
>>Siemens Medical Solutions Health Services
>>Michael Lutz
>>Software Engineer, Soarian Common Components
>>51 Valley Stream Parkway, Malvern, PA 19355
>>Office / Voice Mail   +01 610-219-8613
>>Cell  +01 610-952-2289
>>Home Office   +01 610-989-3623
>>Fax   +01 610-219-4004
>>E-mail <mailto:[EMAIL PROTECTED]>
>>___
>>
>>
>>---
>
>>
>>This message and any included attachments are from Siemens Medical
>>Solutions
>>USA, Inc. and are intended only for the addressee(s).
>>The information contained herein may include trade secrets or
>privileged or
>>otherwise confidential information.  Unauthorized review, forwarding,
>>printing,
>>copying, distributing, or using such information is strictly prohibited
>and
>>may
>>be unlawful.  If you received this message in error, or have reason to
>>believe
>>you are not authorized to receive it, please promptly delete this
>message
>>and
>>notify the sender by e-mail with a copy to
>>[EMAIL PROTECTED]
>>
>>Thank you
>>
>>-
>>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]
>
>---
>
>This message and any included attachments are from Siemens Medical
&g

RE: JDK compatibility

2004-07-21 Thread Shapira, Yoav
Hi,
The Visual J++ JVM is 1.1-compatible supposedly, but it's different from
Sun's 1.1.  Can you run OK on Sun 1.1?  What's the full stack trace for
the NoClassDefFoundError?

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Lutz Michael [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 21, 2004 2:29 PM
>To: Log4J Users List; Anderson Ian
>Subject: JDK compatibility
>
>
>
>We're experiencing problems with Log4j running on J++, JDK 1.1.4.  We
found
>on the FAQ that Log4j is 1.1.x compatible.
>
>Specifically, a NoClassDefFound error is being generated.  Does anyone
have
>any ideas on a work-around, or are we doing something wrong?  Can we
run
>Log4j on Visual J++?
>
>Thanks in advance.
>Mike
>
>___
>Siemens Medical Solutions Health Services
>Michael Lutz
>Software Engineer, Soarian Common Components
>51 Valley Stream Parkway, Malvern, PA 19355
>Office / Voice Mail+01 610-219-8613
>Cell   +01 610-952-2289
>Home Office+01 610-989-3623
>Fax+01 610-219-4004
>E-mail 
>___
>
>
>---

>
>This message and any included attachments are from Siemens Medical
>Solutions
>USA, Inc. and are intended only for the addressee(s).
>The information contained herein may include trade secrets or
privileged or
>otherwise confidential information.  Unauthorized review, forwarding,
>printing,
>copying, distributing, or using such information is strictly prohibited
and
>may
>be unlawful.  If you received this message in error, or have reason to
>believe
>you are not authorized to receive it, please promptly delete this
message
>and
>notify the sender by e-mail with a copy to
>[EMAIL PROTECTED]
>
>Thank you
>
>-
>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: configureAndWatch

2004-06-15 Thread Shapira, Yoav

Hi,
We've done the servlet that reloads the log4j thing in the past: it works well, and 
there's one for your use in the log4j-sandbox.

In the J2EE Spec world (which as others point out has serious limitations in this 
area), the thread creation itself is just as much a problem as the lack of a shutdown 
method.  It's simply against the spec, so technical if you do it your app isn't 
J2EE-compliant ;)  Of course, in practice everyone does it all the time in all the 
containers, but the user originally did ask for the strict spec take on this.

Ceki's absolutely right that the lack of a clean shutdown for configureAndWatch leads 
to bad situations with webapp reloads: we see such questions posted almost daily on 
the tomcat mailing lists.  One suggested solution is to take log4j's watchdog class 
(in the helper package), extend it with a nice shutdown method, and keep a referece to 
it in your ServletContextListener.  Then you can at least shut it down cleanly and not 
affect webapp reloads.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, June 15, 2004 7:36 AM
>To: Log4J Users List
>Subject: Re: configureAndWatch
>
>At 01:31 PM 6/16/2004, you wrote:
>>Hi Ceki,
>>
>>Is there any other way, we can dynamically reload the properties file in a
>>J2EE app,
>
>A good way is to write a servlet that reloads the log4j config when called.
>
>>Regards..
>>
>>- Original Message -
>>From: "Ceki Gülcü" <[EMAIL PROTECTED]>
>>To: "Log4J Users List" <[EMAIL PROTECTED]>
>>Sent: Tuesday, June 15, 2004 2:49 PM
>>Subject: RE: configureAndWatch
>>
>>
>>
>>Yoav,
>>
>>The problem is not the thread itself, but the fact that once started it
>>cannot be stopped until the JVM exits. configureAndWatch does not provide
>a
>>means to close the thread. Imagine the problems when the web-app is
>>recycled and you have multiple configureAndWatch threads running amok. It
>>does not make a pleasant sight.
>>
>>HTH,
>>
>>At 04:24 PM 6/14/2004, you wrote:
>>
>> >Hi,
>> >Read the J2EE Specification guidelines on spawning user threads within a
>> >container to understand why.  configureAndWatch spawns a thread, albeit
>a
>> >daemon, to watch the file.
>> >
>> >Yoav Shapira
>> >Millennium Research Informatics
>> >
>> >
>> > >-Original Message-
>> > >From: Adrian Beech [mailto:[EMAIL PROTECTED]
>> > >Sent: Friday, June 11, 2004 7:35 PM
>> > >To: 'Log4J Users List'
>> > >Subject: RE: configureAndWatch
>> > >
>> > >G'day,
>> > >
>> > >Could you possibly explain as to why this is so?
>> > >
>> > >AB
>> > >
>> > >
>> > >-Original Message-
>> > >From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>> > >Sent: Saturday, 12 June 2004 5:25 AM
>> > >To: Log4J Users List
>> > >Subject: Re: configureAndWatch
>> > >
>> > >
>> > >Hello Mike,
>> > >
>> > >It is *not* OK to use configureAndWatch in a web-app.
>> > >
>> > >At 09:09 PM 6/11/2004, you wrote:
>> > >
>> > >
>> > >>Is it OK to use configureAndWatch in a Servlet?
>> > >>
>> > >>Mike
>> > >
>> > >--
>> > >Ceki Gülcü
>> > >
>> > >  For log4j documentation consider "The complete log4j manual"
>> > >  ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>> > >
>> > >
>> > >
>> > >-
>> > >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]
>> >
>> >
>> >
>> >
>> >This e-mail, including any attachments, is a confidential business
>> >communication, and may contain information that is confidential,
>> >proprietary and/or privileged.  This e-mail is intended only for the
>> >individual(s) to whom it is addressed, and may not be saved, copied,
>> >printed, disclosed or used by anyone else.  If you are not the(an)
>> >intended recipient, please immediately delete this e-mail from your
>> >computer system and notify the sender.  Thank you.
>> >
>> >
>> >-
>> >To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>--
>>Ceki Gülcü
>>
>>   For log4j documentation consider "The complete log4j manual"
>>   ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>>
>>
>>
>>-
>>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]
>
>--
>Ceki Gülcü
>
>  For log4j documentation consider "The complete log4j manual"
>  ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>
>
>
>-

RE: configureAndWatch

2004-06-14 Thread Shapira, Yoav

Hi,
Read the J2EE Specification guidelines on spawning user threads within a container to 
understand why.  configureAndWatch spawns a thread, albeit a daemon, to watch the file.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Adrian Beech [mailto:[EMAIL PROTECTED]
>Sent: Friday, June 11, 2004 7:35 PM
>To: 'Log4J Users List'
>Subject: RE: configureAndWatch
>
>G'day,
>
>Could you possibly explain as to why this is so?
>
>AB
>
>
>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>Sent: Saturday, 12 June 2004 5:25 AM
>To: Log4J Users List
>Subject: Re: configureAndWatch
>
>
>Hello Mike,
>
>It is *not* OK to use configureAndWatch in a web-app.
>
>At 09:09 PM 6/11/2004, you wrote:
>
>
>>Is it OK to use configureAndWatch in a Servlet?
>>
>>Mike
>
>--
>Ceki Gülcü
>
>  For log4j documentation consider "The complete log4j manual"
>  ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>
>
>
>-
>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Separate log file per servlet

2004-06-11 Thread Shapira, Yoav

Hi,

>1) What is the reason for setting additivity to false in this scenario
>2) does additivity need to be set to false for each appender in this
>scenario, or only the first?

In my example, I set additivity to false for all the appenders, because
I didn't know what was in the rest of his configuration file.  It's
better to over-isolate than get multiple copies of logging statements
IMHO, but it's certainly not a requirement, and certainly more details
need to be known in order to establish if that's a good approach for
this scenario.

As for configuring log4j: do it once, in a ServletContextListener's
contextInitialized method, not from a servlet.

As for the shared class using whatever appender its calling class is
using: ack, that's a bit of a pain.  Logging Domains would help here,
but that's log4j 1.3 ;)  You can also do this fairly nicely with some
Aspects (as in AOP Aspects).  You could pass the name of the calling
class, the calling class itself, or the Logger object itself, to all
methods in the shared class.  That's simple and would work, though it's
a bit ugly.  You could figure out the calling class name using stack
trace tricks, but that's costly from a performance perspective.  I don't
know what I'd pick in this scenario, but then again I wouldn't be in
this scenario to start with because I really dislike the "every
component [or class, or whatever] goes into its own log destination"
approach -- I prefer sending everything to one destination and then
filtering/viewing using a good tool like Chainsaw or emacs ;)

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Separate log file per servlet

2004-06-11 Thread Shapira, Yoav

Hi,
Here's one cleaner way, doing nearly everything in the configuration
file:

log4j.properties:
 log4j.appender.foo.bar.appender = ...
 log4j.logger.foo.bar = foo.bar.appender, DEBUG
 log4j.logger.foo.bar.additivity = false

 log4j.appender.foo.baz.appender = ...
 log4j.logger.foo.baz = foo.baz.appender, DEBUG
 ...

Configure log4j once via automatic configuration or whatever mechanism
you desire.

Other approaches exist as well, nearly everything would be cleaner than
the approach in your email: you don't want to configure (andWatch!)
log4j once from each servlet.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Horry, Adam J [mailto:[EMAIL PROTECTED]
>Sent: Friday, June 11, 2004 1:06 PM
>To: [EMAIL PROTECTED]
>Subject: Separate log file per servlet
>
>The web server is configured to be one JVM for all the servlets.
>Numerous people are developing different classes. We want each
>Servlet to write to its own log.
>
>Class X
>{
> ...
> xLog = getLogger( "DEBUG" );
> ...
> xLog.info( "message" );
> ...
>}
>
>Class ServletY extends HttpServlet
>{
> ...
> xLog = getLogger( "DEBUG" );
> ...
> configureAndWatch( );
> ...
> xLog.info( "message" );
> ...
> someMethod()
> {
>  new X();
> }
>}
>
>Class ServletZ extends HttpServlet
>{
> ...
> xLog = getLogger( "DEBUG" );
> ...
> configureAndWatch( );
> ...
> xLog.info( "message" );
> ...
> someMethod()
> {
>  new X();
> }
> ...
>}
>
>log4j.properties:
> ...
> Logger name="DEBUG"
> Appender A
> ...
> Appender A
> ...
>
>Class A extends DailyRollingFileAppender
>{
> String _file = null;
>
> a( )
> {
>  super.init();
>  setFile( "" );
> }
>
> setFile( aFile )
> {
>  // Throw stack trace to figure out which servlet called you
>  ...
>  // add path and .log to get filename like /tmp/ServletY.log or
>  // /tmp/ServletZ.log
>  _file = "newFile";
> }
>}
>
>Now the problem: When the first servlet comes up, say ServletY, it
>configures and creates /tmp/ServletY.log. ServletY and X write to
>the file and everyone is happy. Now the next servlet comes up, say
>ServletZ. It configures and creates /tmp/ServletX.log. Now
>everything writes to this log but not the other.
>
>So I guess what I am looking for is how I can I do logging on a
>servlet basis that writes to a particular log. The various support
>classes need to call something generic because they do not know
>which specific servlet called them.
>
>Thanks,
>Adam
>
>[EMAIL PROTECTED]
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: What is the significance of rootCategory in property file.

2004-06-04 Thread Shapira, Yoav

Hi,

>Thanks alot for the information.
>Can I have any number of log4j properties files under a single web
>application ?

Yes.  In case of conflicts the last one configured using
Configurator#configure (or a variant thereof) will determine the
configuration.

>If so, where to put these properties files under tomcat ?

Wherever you want.  To configure with multiple files you'll have to
configure log4j programmatically anyways, so put the files wherever you
want and adjust your code accordingly.

>Are there any guidelines that I have to follow if there are many
>lo4j properties under a single web app ?

Nothing special.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: What is the significance of rootCategory in property file.

2004-06-03 Thread Shapira, Yoav

Hi,
The root category is not required in configuration files.  It is
implicitly created for you whether you specify details for it or not.
Most people specify it in order to set the basic level of logging for
their system such that 3rd party libraries using log4j aren't logging at
too verbose a level.

I can't help much with India-specific book purchase questions, besides
the obvious avenues I'm sure you're already explored, such as Amazon and
eBay, that ship internationally.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Narendra Babu Kirthi [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 03, 2004 1:54 AM
>To: [EMAIL PROTECTED]
>Cc: Narendra Babu Kirthi
>Subject: What is the significance of rootCategory in property file.
>
>Hi,
>Can some one explain me what is the significance of rootCategory,
>that is specified in the log4j.properties file ?
>Is it a must to have rootCategory in the properties file ?
>I have a web application under tomcat. This web application is
>integrated from different modules (my project specific)
>and each module has its own log4j property(with different names)
>file. Say it has got some 8 modules and got 8 log4j properties files.
>Each module has got an entry of rootCategory in their own log4j
>property file. With this configuration, my web application is
>behaving strangely at times. i.e one module's log messages are
>logged into some other module's log file.
>Can I have any number of log4j properties files under a single web
>application ? If so what is the location under tomcat where I can
>put all these property files. I tried to buy the Log4j manual by
>Ceiki, but could not find a store in Chennai (INDIA), where I can get
>that book. Can some one point me to the location in India, where I
>can get this book.
>
>Thanks
>Naren
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: ObjectRenders

2004-06-03 Thread Shapira, Yoav

Hi,
ObjectRenderers do not replace a Layout.  They are classes that know how to render 
objects of a specific class.  For example:

class A {
  private int a;
  public int getA() { return a; }

  private int b;
  public int getB() { return b; }
}

public class ARenderer implements ObjectRenderer {
  public String doRender(Object o) {
if(o == null) {
  return null;
} else if {! (o instanceof A)) {
  return null;
} else {
  A obj = (A) o;
  return "Sum = " + (obj.getA() + obj.getB());
}
}

They are specified in a properties configuration file as follows:
log4j.renderer.A = ARenderer

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Søren Ehrhorn [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 03, 2004 7:36 AM
>To: '[EMAIL PROTECTED]'
>Subject: ObjectRenders
>
>Hi,
>
>Im trying to incorperate ObjectRenders in min J2EE framework, but i dont
>know howto. Do they replase Layout??
>
>
>Regards,
>Søren
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: automatic LOG4J configuration reloading ?

2004-06-03 Thread Shapira, Yoav

Hi,
The watchdogs are not available for automatic configuration, only for programmatic 
configuration, by invoking the Configurator#configureAndWatch method.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Vernier, Dominique (DVernier) [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 03, 2004 3:42 AM
>To: Log4J Users List
>Subject: RE: automatic LOG4J configuration reloading ?
>
>
>Hi,
>
>Log4j has a watchDogs system, means as soon as your config change it reload
>it.
>I don't know by heart how to setup it.
>
>Regards
>Dominique
>-Original Message-
>From: Ionel GARDAIS [mailto:[EMAIL PROTECTED]
>Sent: jeudi 3 juin 2004 9:39
>To: [EMAIL PROTECTED]
>Subject: automatic LOG4J configuration reloading ?
>
>
>Hi folks,
>
>Is there a way to do an automatic reloading of the
>log4j configuration declared as -Dlog4j.configuration ?
>
>=
>--
>Regards,
>Ionel
>
>
>
>
>
>
>Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
>Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
>
>Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez
>Yahoo! Messenger sur http://fr.messenger.yahoo.com
>
>-
>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]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: BasicConfigurator

2004-05-26 Thread Shapira, Yoav

Hi,
Take advantage of what's there.  It's a simple rationale and I like it
;)  If there's nothing there, no harm done.  This is an excellent way
for someone who knows log4j but must debug an app to whose source code
there's no access to configure logging.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 26, 2004 11:30 AM
>To: [EMAIL PROTECTED]
>Subject: BasicConfigurator
>
>
>
>
>
>Basic Configurator is supposed to configure a ConsoleAppender. When you
>call configure, it starts looking for log4j.xml and log4j.properties in
the
>classpath. What was the rationale behind the decision to try to load
the
>configuration files, when the program explicity uses BasicConfigurator
>(configure a console appender).
>
>
>---

>---
>**
>The information contained in this communication is confidential,
private,
>proprietary, or otherwise privileged and is intended only for the use
of
>the
>addressee.  Unauthorized use, disclosure, distribution or copying is
>strictly
>prohibited and may be unlawful.  If you have received this
communication in
>error, please notify the sender immediately at (312)653-6000 in
Illinois;
>(972)766-6900 in Texas; or (800)835-8699 in New Mexico.
>**
>===

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




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: FileAppender file path in a web app

2004-05-26 Thread Shapira, Yoav

Hi,
This question is routinely addressed on the tomcat-user mailing list:
you may wish to search that list's archives for the myriad approaches
and solutions that people have proposed over the years.

Common ones include:
- NOT to use a relative filename, as the definition of Current Working
Directory is far from portable,
- Use Ant tokens in your configuration files (if you use a log4j
configuration file) and substitute appropriate values when
packaging/deploying your webapp
- Use System Properties (e.g. ${CATALINA_HOME}/logs/myLog.txt) -- this
approach is frequently suggested on this list and examples/discussion
are in the archives
- Use a env-entry/env-entry-ref combination: while this is the most
heavyweight, it's also the most portable and most in line with the J2EE
spec, leaving it up to the server admin to tell your webapp where to
log.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Stephen Pain [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 26, 2004 5:54 AM
>To: Log4J Users List
>Subject: Re: FileAppender file path in a web app
>
>
>Keith,
>
>When we deploy to our managed hosting service, they tell us to use
>"../logs/filename.log" - obviously this doesn't guarantee that the same
>will work for you, but it does demonstrate that relative filenames
work!
>
>Unfortunately I don't have access to tell you exactly where ../ points
to,
>but your hosting service might be able to suggest a similar location?
>
>Cheers,
>Stephen
>
>
>
>
>  "Keith Rogers"
>  <[EMAIL PROTECTED]To:   [EMAIL PROTECTED]>
>  arkman.com>   cc:
>Subject:
FileAppender
>file path in a web app
>  26/05/2004 10:19
>  Please respond to
>  "Log4J Users List"
>
>
>
>
>
>
>How would I specify a path for file appenders to use in a web-app? I
can
>specify an absolute path, but while this is fine on my development
>server, it will be a problem when I deploy to the hosting service we
>use, as I don't know what the file structure is above our application
>directory. What I'd really like is to just be able to specify
>/web-inf/logs/debug.log
>
>I've tried using relative filenames, but this does not seem to work.
>
>
>The information in this e-mail is confidential and intended to be
solely
>for the use of the addressee(s) and may contain copyright and/or
legally
>privileged information.  If you are not the addressee (or responsible
for
>delivery of the message to the addressee) please e-mail us at
>[EMAIL PROTECTED] and delete the message from your
computer;
>copying, distribution, use or disclosure of its contents is strictly
>prohibited.
>As Internet communications are capable of data corruption no
responsibility
>is accepted for changes made to this message after it was sent. For
this
>reason it may be inappropriate to rely on advice contained in any
e-mail
>without obtaining written confirmation of it.
>In addition, no liability or responsibility is accepted for viruses and
it
>is your responsibility to scan attachments (if any).
>Please note that for business purposes, outgoing and incoming emails
from
>and to the company may be monitored and recorded.
>
>Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis
Road,
>West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>--
>
>This e-mail may contain confidential and/or privileged information. If
you
>are not the intended recipient (or have received this e-mail in error)
>please notify the sender immediately and destroy this e-mail. Any
>unauthorized copying, disclosure or distribution of the material in
this e-
>mail is strictly forbidden.
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: long initialization delay

2004-05-19 Thread Shapira, Yoav

Hi,
Run it inside a profiler to see where CPU time is spent.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Shriver, Derrick [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 19, 2004 4:09 PM
>To: '[EMAIL PROTECTED]'
>Subject: long initialization delay
>
>I'm getting a 2-5 minute delay when making the call to
>PropertyConfigurator.configure(file) to initialize Log4j. I'm running
>log4j-1.2.8  inside iPlanet 6.0, jdk 1.3.1, on Solaris.  We have other
apps
>using this version of log4j on that same server and they don't have
this
>problem.  This code sits within an initializer servlet.
>
>I've tried putting the config file in various places and get the same
>result.  I've also tried sending a properties file to configure() in
hopes
>that it was a parsing or URL resolution problem; no luck.  And I've
tried
>completely rewriting the config file from scratch using a sample from
>manual.html.
>
>Any suggestions as to why this is happening?  Or even a way to figure
out
>what is happening or blocking during the delay?
>
>FWIW the code runs fine on my Windows JDK 1.3.1.
>
>
>System.setProperty( "log4j.defaultInitOverride", "true" );
>String file = ( new File(
this.getServletContext().getRealPath("/"
>)
>+ File.separator +
>"WEB-INF/classes/log4j.properties" )).getAbsolutePath();
>// if the log4j-init-file is not set, then no point in trying
>if(file != null) {
>  org.apache.log4j.PropertyConfigurator.configure(file);
>  org.apache.log4j.Logger myLogger =
>org.apache.log4j.Logger.getLogger( "R" );
>  myLogger.debug( "SearchServiceInitializer.init(): logged
through
>myLogger" );
>} else {
>throw new RuntimeException( "Log4j config file not found: "
+
>file );
>}
>
>
>log4j.properties (taken directly from
>http://logging.apache.org/log4j/docs/manual.html )
>--
>log4j.rootLogger=debug, stdout, R
>
>log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>
># Pattern to output the caller's file name and line number.
>log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
>
>log4j.appender.R=org.apache.log4j.RollingFileAppender
>log4j.appender.R.File=/tmp/example.log
>
>log4j.appender.R.MaxFileSize=100KB
># Keep one backup file
>log4j.appender.R.MaxBackupIndex=1
>
>log4j.appender.R.layout=org.apache.log4j.PatternLayout
>log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
>
>
>Thanks,
>-Derrick
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How to apply the apache license to documents

2004-05-14 Thread Shapira, Yoav

Hi,

>b.t.w. The license link on http://logging.apache.org still refers to
the
>1.1 license whereas the link at
>http://logging.apache.org/site/binindex.cgi when I try to download
log4j
>refers to 2.0 license.

El fixo has been completo.  (Apologies to any Spanish speakers on the
list)

Yoav




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How to apply the apache license to documents

2004-05-13 Thread Shapira, Yoav

Howdy,
IANAL (that's really becoming a common acronym, it's too bad we all have
to deal with this ;)), the Apache License may apply to all Apache
intellectual property.  That includes software, but also documentation
and other stuff (e.g. mailing lists, for example ;)).  So you can
slightly modify the sentence you quoted to read "This document is
publishes under the terms of ..."  By the way, you should be using the
2.0 Apache license, not 1.x.

Further questions on the license can be directed to [EMAIL PROTECTED]
(or it might be [EMAIL PROTECTED], I'm never sure) and/or
[EMAIL PROTECTED], where you will get many better explanations of the
license's applicability to documents.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Dirk Schnelle [mailto:[EMAIL PROTECTED]
>Sent: Thursday, May 13, 2004 3:55 AM
>To: Log4J Users List
>Subject: How to apply the apache license to documents
>
>Hi,
>
>I want to add an explicit statement of the apache license to my german
>translation of the 'short introduction to log4j'.
>
>But this license only applies to software. I realized that Ceki added
>the sentence
>
> This software is published under the terms of the Apache Software
>License version 1.1, a copy of which has been included in the
>LICENSE.txt file shipped with the log4j distribution.
>
>to his article. This is the best I can do for now, but is this correct?
>Is a document the same as a piece of software? I am not a lawyer, but I
>want to get an official response before adding this to my document.
>
>/Dirk
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: DailyRollingFileAppender

2004-05-12 Thread Shapira, Yoav

Hi,

>I've got a DailyRolloingFileAppender and I want to keep only the last 7
>days. Is this possible?
>
>If not, has anyone built a custom appender for that?

No to the first question in log4j 1.2, yes in log4j 1.3.  Yes to the
second question, you can search the list archives for
ExtendedDailyRollingFileAppender or DailyRollingFileAppenderExt or
something like that.

Yoav



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How Do I Find Out If log4j Has Been Configured?

2004-05-07 Thread Shapira, Yoav

Hi,

>I've been thinking about these opinions since they were posted a few
>days ago, and I can't get away from being puzzled by them.  What
>rational purpose does this serve?

Don't hide stuff unless asked for.  The purpose of a logging system is
to log.  If something critical happens on that first clueless time and
we didn't log it due to performance reasons, I'd be very unhappy with
the logging system.  It's a simple idea, simple point, and I see that we
have differing opinions on it, which is totally fine.  I respect your
point of view and I understand it.  We both agree that people should
take care to configure their logging systems as they see fit whenever
possible.  I think hiding information is a bigger penalty than slowing
down performance, wheras you like the opposite, and that's that ;)

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Platform dependencies problem

2004-05-07 Thread Shapira, Yoav

Hi,
See http://marc.theaimsgroup.com/?l=log4j-user&m=106201384129366&w=2.

You may also wish to consider alternative approaches:
- An ant token replacement mechanism (filled in when you create the WAR
file or deploy your application)
- Programmatic configuration
- There are more but I have to run.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Yansheng Lin [mailto:[EMAIL PROTECTED]
>Sent: Friday, May 07, 2004 3:38 PM
>To: 'Log4J Users List'
>Subject: Platform dependencies problem
>
>Hi,
>
>Currently I have my log output file configured as absolute path in my
>properties file.  I have tried to use system variable,
>${TOMCAT_HOME}/myProject/logs/debug.log, but this never seems to work.
>
>Anyone got this one working on their system, specifically windows and
>linux?
>I would like to know if there is a tutorial out there listing the
steps.
>This is a pain when I when to develop my code in a different platform.
>
>Thanks a million!
>
>-Yan
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: german translation of the log4j short manual

2004-05-04 Thread Shapira, Yoav

Hi,
I've added it.  Before doing so I checked there's a reference to the Apache license.  
But I don't read German, so it may be the reference is not highlighted enough.  Thanks 
for the translation,

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, May 04, 2004 10:14 AM
>To: Log4J Users List
>Subject: Re: german translation of the log4j short manual
>
>
>Hello Dirk,
>
>Nice work. We will gladly add a link to your document under the "
>
>Translations to other languages" section.
>
>I am not a lawyer but your translation can be considered as derivative
>work, and as such, the terms of the Apache License apply. In other words,
>in order to be on legal side of the fence, you should reproduce the Apache
>Licence, or at least add http://www.apache.org/LICENSE to your list of
>references. You should also explicitly recognize that your translation is
>based on work licensed under the term of the Apache License.  These are
>relatively minor steps, easy to comply with.
>
>Anyway, thank you for your work in translating the short manual.
>
>At 03:47 PM 5/4/2004, Dirk Schnelle wrote:
>>Hi,
>>
>>I translated the short manual from Ceki Gülcü to german. It can be
>>downloaded in pdf format from
>>
>>http://www.javacore.de/jumpToDownload.php?id=8&url=tutorials/schnelle/log4
>jmanual.pdf
>>
>>Can you add this link to the list of translations at
>>
>>http://logging.apache.org/log4j/docs/documentation.html
>>
>>/Dirk
>
>--
>Ceki Gülcü
>
>  For log4j documentation consider "The complete log4j manual"
>  ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: RFE - Fixed Memory Logging

2004-04-30 Thread Shapira, Yoav

Hi,
You can use RollingFileAppender with a a max backup index of 0.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Paul Smith [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 29, 2004 8:31 PM
>To: 'Log4J Users List'
>Subject: RE: RFE - Fixed Memory Logging
>
>>
>>
>> Actually, I think the title is a bit of a misnoma as it's
>> disk space I'm
>> looking to cap the usage of.
>>
>> I was wondering if anything in 1.3 would enable me to ensure
>> I won't run
>> out of hard drive.  I know it's cheap and all that but,
>> depending on the
>> performance cost, I'd like to be able to guarantee that I
>> won't run out
>> of space if I have a sudden rush on system usage.
>>
>> What I envision is a class that would be passed the 'rolled' files
and
>> would keep track of them.  When the total file sizes exceed a given
>> trigger value it would delete the oldest files, until the
>> size was at an
>> acceptable amount.
>>
>> Does anyone else think this would be a nice feature?
>>
>
>I personally think this would be an awesome feature.  It would work
well
>within the Plugin architecture, and be able to told to 'manage' a
>particular
>Appender.  Feel free to flesh out any ideas you have on the log4j-dev
list
>if you like.
>
>cheers,
>
>Paul Smith
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How Do I Find Out If log4j Has Been Configured?

2004-04-30 Thread Shapira, Yoav

Hi,
You know, though, I would argue that in the absence of any configuration
all logging statements should be output to the console.  So in a sense,
I'd like to have BasicConfigurator.configure called automatically on the
first logging statement if no other configuration has been done.  Then
you'd get the current warning that log4j hasn't been configured, and
from that point on all output at DEBUG level to the console.  The
principle that a logging system should never hide/reject logging
statements unless explicitly configured to do so is very strong.  It
trumps everything else a logging system should do, pretty much,
including good performance.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: WJCarpenter [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 29, 2004 5:47 PM
>To: Log4J Users List
>Subject: RE: How Do I Find Out If log4j Has Been Configured?
>
>ys> That would be a good safe practice, yeah: if you're writing a
>ys> library, and are relying on someone else to provide the
>ys> configuration for logging, you should check that the logging was
>ys> indeed configuration and if not take action (raise exception,
>ys> configure it for your needs, whatever).
>
>The trouble is that a library writer doesn't generally know what a
>good level of logging is for any particular caller.  A reasonable
>thing to do, very often, would be to say "OK, I'll just accept the
>logging configuration of my environment since they know best".  It can
>be painful for the application writer to keep up with the wants and
>needs of all the components s/he reuses, so a principal of "reasonable
>defaults" is a hopeful expectation.
>
>ys> But if I now understand you correctly that you're talking about
>ys> the case where not even BasicConfigurator.configure is called,
>ys> then we have a different story and my -1 is misplaced perhaps.
>
>Yeah, that's the case I'm talking about: when no configuration is done
>at all.  Sorry if that wasn't clear.
>
>Quite often (I see this firsthand all the time), the person running
>the application will say "I'll figure out logging later, just let me
>run this application and I don't care right now if it doesn't log
>anything".  They are unaware that not having a configuration for log4j
>gives them this performance penalty.  In fact, when told this, you can
>see a blinky look in their eyes, and they say "but the log has only a
>couple lines about log4j ... how could I possibly be doing tons of
>unnecessary logging?"  When you explain to them that the log messages
>get created and then thrown away, they just look at you like you're
>slightly crazy.
>
>Anyhow, I more or less agree that any application savvy enough to call
>BasicConfigurator.configure is savvy enough to ask for the logging it
>wants.  My use case is for applications that are completely unaware of
>log4j because it comes in a library that is being reused.  I don't
>think it should be up to libraries to decide about that stuff, but
>today the library author has to do something because of the
>inconvenient log4j default.  (It's also a bit obvious that log4j
>doesn't anticipate someone doing this when you look at the contributed
>code sample for doing the check.)
>
>It also slightly complicates the library to have to do the check since
>you pretty much need to have the check for log4j configuration in some
>static initializer for a class, and you have to make sure that class
>is loaded before you do any logging stuff.  Not the end of the world,
>but slightly annoying.
>
>(Hey, things could be worse.  The Apache Axis folks for a while
>included a log4j.properties file in axis.jar, and it turned on a INFO
>logging at the root level, IIRC.  Well, it might not have been a ton
>of logging for Axis, but not everybody uses the same conventions for
>what to log and when.  Their file defeated any normal "is it
>configured yet?"  check.  The only cure was too delete that file from
>axis.jar [which the Axis folks have done themselves in recent betas].)
>--
>[EMAIL PROTECTED] (WJCarpenter)PGP 0x91865119
>38 95 1B 69 C9 C6 3D 2573 46 32 04 69 D6 ED F3
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How Do I Find Out If log4j Has Been Configured?

2004-04-29 Thread Shapira, Yoav
Hi,

>I don't understand your comments.  With the current defaults there are
>no appenders, so *no* information is logged except a single console

I thought you meant the default configuration as in
BasicConfigurator.configure being called?  Maybe I misunderstood your
original point.

>least reasonable).  What if you're using log4j in a library?  It's not
>up to you (the library writer) to decide what configuration the
>calling application wants.  You're in effect saying that every
>component using log4j should go through the little "is it already
>configured?" dance that was just discussed on this list, because you
>can't know how your library will be combined with other components,
>and you can't depend on somebody else checking the configuration.

That would be a good safe practice, yeah: if you're writing a library,
and are relying on someone else to provide the configuration for
logging, you should check that the logging was indeed configuration and
if not take action (raise exception, configure it for your needs,
whatever).

>What is the advantage of logging at DEBUG level if there are no
>appenders?

There's no advantage at all if there are no appenders.  If
BasicConfigurator.configure() is called there is one appender, attached
to the root logger, at DEBUG level, so nothing is hidden.  But if I now
understand you correctly that you're talking about the case where not
even BasicConfigurator.configure is called, then we have a different
story and my -1 is misplaced perhaps.

Yoav Shapira


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



RE: How Do I Find Out If log4j Has Been Configured?

2004-04-29 Thread Shapira, Yoav

Hi,

>Instead, I have finally gotten around to writing a bug report about
>the funky default behavior in log4j (which is my main reason for
>wondering it log4j is already configured).
>
>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28692

I've -1's this (message below), but stopped short of marking it as
invalid/wontfix or something like that.

"I'm -1 on changing this: in the absence of explicit configuration, it's
better to have more information than less, so the current default is
best.  Obviously there'll be scenarios where it's expensive and/or
ill-fitting, but those people should explicitly configure log4j.  The
default config of a logging system should never hide/reject logging
statements."

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: An odd configuration need...

2004-04-29 Thread Shapira, Yoav

Hi,

>So I'm still leaning toward writing my own subclass of FileAppender
that
>merges the features of Daily and Rolling, with the Daily part of the
>functionality creating new Directories for the 'rolling' functionality
>to 'roll' within.
>
>In an ideal world there would be hooks inside FileAppender to enable me
>to define my own rolling point and my own archiving method.  Perhaps it

This ideal world exists in log4j 1.3.  Grab it from CVS and give it a
whirl.
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4
j/rolling/

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How Do I Find Out If log4j Has Been Configured?

2004-04-28 Thread Shapira, Yoav

Hi,

>Why can't you simply use a static initializer in your EJB to configure
>Log4J?  I.e:
>
>static {
>PropertyConfigurator.configure("myfile.properties");
>}

I'll answer for the original poster: for several reasons.  What if a 3rd
party library (or another part of the code you simply forgot about) has
already configured log4j?  You'd end up with multiple duplicate
appenders at best, meaning duplicates in the log files.  What if the
application is restarted or classes otherwise reloaded, causing the
static initializer to fire again?  Same story.

Checking if a library has been initialized before initializing it is a
good safe programming practice.  It should be commended and assisted.
Hence the sample code in the log4j wiki and the relevant enhancements in
log4j 1.3.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How big is log4j?

2004-04-27 Thread Shapira, Yoav

Hi,

>I calculated the number of inserted code lines versus the amount and
>ratio of bytes have increased the class files.
>
>Here are the results of my investigations:
>
>Test Application:  1) naked2) println()3) logging()
>total Code lines:  420 435 440
>print/log Code lines:  0   15  20
>total class bytes: 17118   18054   18892
>code line ratio:   -   3,4 %   4,5 %
>class byte ratio:  -   5,5 %   10,4 %
>
>Conclusion:
>Replacing legacy System.out.println() by logging with log4j doubles the
>amount of memory used in addition to a naked (non traced) application.

What you've done is calculate file sizes, and that's fine, but doesn't
say anything about runtime memory usage.  Memory usage switching from
System.out.println() to log4j certainly doesn't double for any
real-world application.  (Of course, 400 LOC is unlikely to be a
real-world application anyhow, this is just a test, I understand).

>So if we were stingy logging, it wouldn't burst our system.
>But the library  log4j-1.2.8.jar could be too big for us.
>Is it possible to simply remove unused classes - as for instance xml -
>from the library to  slim it?

I don't know, I haven't tried.  You would need to be careful to remove
only unreferenced classes: for example, you can't remove WriterAppender,
even though you don't use it directly, because you use FileAppender.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: getRealPath() and PropertyConfigurator.configure

2004-04-16 Thread Shapira, Yoav

Hi,
PropertyConfigurator.configure(getServletContext().getResource("/WEB-INF
/log4j.properties")).  The getResource call returns a readable URL.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Mark Himsley [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 16, 2004 12:43 PM
>To: [EMAIL PROTECTED]
>Subject: getRealPath() and PropertyConfigurator.configure
>
>Hi,
>
>I've googled and looked in the mail archives but I've failed to find
>
>If PropertyConfigurator.configure() accepts a String, a URL or a
Properties
>object
>
>and we are using log4j in a servlet
>
>and it is unwise to use getServletContext().getRealPath("/") in a
servlet
>because it might be in an unexpanded WAR and we are making our
application
>compatible with that
>
>then in what way should we configure our logger?
>
>All the examples I've seen (including the one in the documentation) use
a
>String containing a filename built from using getRealPath.
>
>Thanks in advance.
>
>--
>Mark Himsley
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: DateFormatFileAppender

2004-04-15 Thread Shapira, Yoav

Howdy,
I'm not a big fan of this ;)  You can get DailyRollingFileAppender to put the file in 
a directory by simply specifying the directory as part of the log file name.  Then the 
log file and all its rolled over versions stay in that directory.

But whether I'm a fan or not doesn't matter as much as the fact this class is not in 
the spirit of our new rolling/triggering policies.  We've spent a lot of time making 
these more flexible for log4j 1.3, and you can see the relevant code at 
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4j/rolling/.

Nonetheless, thanks for contributing,

Yoav Shapira
Millennium Research Informatics

-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 10:22 AM
To: '[EMAIL PROTECTED]'
Subject: RE: DateFormatFileAppender

1. Sending to correct list now.  Sorry.
2. DateFormatFileAppender is different than DailyRollingFileAppender as far as I can 
tell.  I couldn't get DailyRollingFileAppender to put the file in a subdirectory based 
on the date.  Looking at the code it doesn't look like subdirectories in the pattern 
are supported.  The other difference is that DailyRollingFileAppender has the current 
logs always in the same file (the old logs are named based on date).  
DateFormatFileAppender names the current file based on the date.
   Sample File: 'logs/'/MM-MMM/dd-EEE/HH-mm-ss-S'.log'
   Makes a file like: logs/2004/04-Apr/13-Tue/09-45-15-937.log
I have also changed the code so that it takes an option "Separate" so that each log is 
in a separate file (and the File option is re-evaluated each time).  This is useful 
when logging errors with stack traces.  I can provide more information if anyone 
thinks that might be good to add to log4j.  Either way it is working well for us so 
far.  I attached the current code but it is in a package from our code right now (easy 
to change).
James Stauffer
(Thanks for the great product!)
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 7:55 AM
To: Log4J Developers List
Subject: RE: DateFormatFileAppender

Hi,
1. This already exists (DailyRollingFileAppender in log4j 1.2 and various options in 
log4j 1.3),
2. This is the wrong list: log4j-user is the place.
Yoav Shapira
Millennium Research Informatics
-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 11:25 AM
To: '[EMAIL PROTECTED]'
Subject: DateFormatFileAppender
I posted a message to the user list titled "Logs separated by year/mon/day."  It 
doesn't look like any current appenders support what I am trying to do so I wrote a 
new appender (attached).  It works but probably needs to be cleaned up (formatting, 
etc) to fit in log4j.  (The only change I made after my last run with it was to change 
the package.)  I also don't know if I did things the "preferred" way.  It is a simple 
class.  It just overrides setFile(String, boolean, bufferedIO, bufferSize) to format 
the given fileName and produce another fileName (producing directories as necessary).  
Is this something that you would be interested in having in log4j?  If yes, I can 
clean it up more and follow any advice you have.  I tried bugzilla but it appears to 
be down right now.  Questions and comments are welcome.
 
James Stauffer
 

This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.

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



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: How big is log4j?

2004-04-15 Thread Shapira, Yoav

Hi,
I don't know, but it wouldn't be difficult to track with a profiler, and
then please post the results to the list as I'm sure others are curious
;)

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Ralf Beger [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, April 14, 2004 11:16 AM
>To: [EMAIL PROTECTED]
>Subject: How big is log4j?
>
>How big is log4j?
>
>I'm looking for a logging tool in embedded systems.
>The performance of log4j would meet our expectations.
>We want to use log4j in a mid extent
>(up to 3 Appenders: console, file, syslogd).
>But how much memory needs log4j, once compiled with an application.
>
>Kind regards, Ralf
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: having a separate log file for every client in a J2EE App.

2004-04-09 Thread Shapira, Yoav

Hi,
I would hope your hold on your job is not as tenuous as you describe ;(

Here's an approach: in your login code (presuming you have a login page,
filter, servlet, or something like that) or home page, create a new
FileAppender for the user.  Make sure the append property is true so you
don't overwrite older logs, e.g. from yesterday.

I'll make a few assumptions to show this in code, but they're general
enough so that this is realistic/useful:
- You have an HttpSession for the user
- You have a login page called LoginServlet (this can be a filter or a
JSP easily)

So in the login servlet's doGet/doPost method, you'd do something like
this:

// Authenticate user, get a string with the userID
String userId = ...;

// Get the session, from it get a logger for the user
HttpSession session = request.getSession();
String userLoggerName = session.getAttribute("loggerName");
Logger userLogger;

// If the logger doesn't exist, create it
if(userLoggerName == null) {
  userLoggerName = "logger for " + userId;
  // Create the logger and appender for this user
  String fileName = logDirectory + File.separator + userId + ".txt";
  Layout logLayout = ... // Use layout of your choice
  FileAppender userAppender = new FileAppender(logLayout, fileName,
true);
  userLogger = Logger.getLogger(userLoggerName);
  userLogger.addAppender(userAppender);
  userLogger.setAdditivity(false);
  session.setAttribute("loggerName", userLoggerName);
} else {
  userLogger = Logger.getLogger(userLoggerName);
}

// Use it
userLogger.info("User " + userId + " authenticated.");

Other pages and parts of your application just have to do:
String userLoggerName = session.getAttribute("loggerName");
Logger userLogger = Logger.getLogger(userLoggerName);

If you want to hang these loggers off a singleton instead of sessions,
you can, and it's a good idea of you don't want/can't pass sessions
around.

Note that the logger name and not the Logger itself is stored as a
session attribute because Logger is not Serializable.

Finally, note that I don't think this is a great idea because you're
losing some log4j feature like logger hierarchy and class-specific
logging.  But if it's a business requirement, you can't do much about it
I presume.

Log4j 1.3 domains would be nice here as well.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Piyush Kar [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 09, 2004 11:29 AM
>To: [EMAIL PROTECTED]
>Subject: having a separate log file for every client in a J2EE App.
>
>Hi
>
>we have a need in our J2EE App. to be able to have a
>a separate log file for every client . I know this
>sounds weird but ours is an intranet app and we have a
>max. of 20 clients and the business requires  for a
>separate log file for every client .
>
>I am in a dilemma as how to achieve this . I had tried
>an approach by MDC whereby I could log all messages
>coming from every client identified by hostname into a
>single log file but the business users did not like
>the idea . So can any of teh folks out there help me
>with this . I mean how do I go about this ..
>
>Ant tips/code snippets would be real cool. If I dont
>get his knocked out then my job is sure gone !! so
>pleasee folks do help me !!
>
>Thanks
>
>Kar
>
>__
>Do you Yahoo!?
>Yahoo! Small Business $15K Web Design Giveaway
>http://promotions.yahoo.com/design_giveaway/
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Is it possible to set log levels at runtime?

2004-04-07 Thread Shapira, Yoav

Hi,
>How do I configure log4j to use Configurator#configureAndWatch. My

Instead of relying on default initialization, you write code that
configures log4j: follow the tutorial, search this list's archives, look
up examples online, or buy the book if you're not sure how to do this.

>And are there any performance
>implications of doing this versus the default (Configurator#configure)

Yes, there are.

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Is it possible to set log levels at runtime?

2004-04-07 Thread Shapira, Yoav

Hi,
Yes, if you configure log4j using Configurator#configureAndWatch (rather
than just Configurator#configure which is the default).

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Samir Shaikh (ex 444) [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, April 07, 2004 1:25 PM
>To: 'Log4J Users List'; [EMAIL PROTECTED]
>Subject: RE: Is it possible to set log levels at runtime?
>
>Hi,
>Can I change the log4j.properties file and expect the application to
change
>at runtime (i.e. w/o restarting the app)?
>Thanks.
>Samir
>
>-Original Message-
>From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>Sent: Friday, April 02, 2004 6:04 AM
>To: Log4J Users List; [EMAIL PROTECTED]
>Subject: RE: Is it possible to set log levels at runtime?
>
>
>
>Hi,
>Yes, it's possible and has always been, as it's a core log4j feature.
I
>personally have a simple servlet that takes two string parameters, the
>logger name and level, and does
>Logger x = Logger.getLogger(request.getParameter("loggerName"));
>x.setLevel(Level.toLevel(request.getParameter("loggingLevel")));
>(I actually have a bit more error checking for null parameters, but the
>above is the meat of it).
>
>As for JMX, I think it's possible but haven't tried it.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
>>From: Michael Mattox [mailto:[EMAIL PROTECTED]
>>Sent: Thursday, April 01, 2004 11:50 PM
>>To: [EMAIL PROTECTED]
>>Subject: Is it possible to set log levels at runtime?
>>
>>Is it possible to set log levels (for example go from INFO to debug)
at
>>runtime, without restarting the application??  Would it be possible to
>set
>>the log level with JMX?  I'm curious how people are doing this in
>>production.  It seems like a very useful thing to turn on/off debug
>logging
>>for an app running in production.
>>
>>Thanks
>>Michael
>>
>>
>>
>>-
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary
>and/or privileged.  This e-mail is intended only for the individual(s)
to
>whom it is addressed, and may not be saved, copied, printed, disclosed
or
>used by anyone else.  If you are not the(an) intended recipient, please
>immediately delete this e-mail from your computer system and notify the
>sender.  Thank you.
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Is it possible to set log levels at runtime?

2004-04-02 Thread Shapira, Yoav

Hi,
Yes, it's possible and has always been, as it's a core log4j feature.  I
personally have a simple servlet that takes two string parameters, the
logger name and level, and does
Logger x = Logger.getLogger(request.getParameter("loggerName"));
x.setLevel(Level.toLevel(request.getParameter("loggingLevel")));
(I actually have a bit more error checking for null parameters, but the
above is the meat of it).

As for JMX, I think it's possible but haven't tried it.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Michael Mattox [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 01, 2004 11:50 PM
>To: [EMAIL PROTECTED]
>Subject: Is it possible to set log levels at runtime?
>
>Is it possible to set log levels (for example go from INFO to debug) at
>runtime, without restarting the application??  Would it be possible to
set
>the log level with JMX?  I'm curious how people are doing this in
>production.  It seems like a very useful thing to turn on/off debug
logging
>for an app running in production.
>
>Thanks
>Michael
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Another Newbie Question

2004-04-01 Thread Shapira, Yoav

Hi,
>- When using a daily file roll, is the file overwritten
>every night - or is it timestamped and a new file is
>created?  Or will I have to script this myself?

It's timestamped and a new one created, e.g. myLog becomes
myLog.2004-03-31 and a new file called myLog is created.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Multiple configuratorClass on Tomcat

2004-03-31 Thread Shapira, Yoav

Hi,

>personal tasks), so I set the following system property :
>
>-Dlog4j.configuratorClass=mypackage.MyConfigurator

This system property will then be set for all the webapps, as they all
share the same JVM instance.

>Please note I can use a Servlet.init() to configure Log4J because
>some librairies (Hibernate) use log4j to display infos before any
>servlet is initialized by Tomcat.

You mean you can NOT use a Servlet#init method, right?  Use a
ServletContextListener instead of a Servlet#init method.  This will get
called before any of your libraries are initialized.  In that listener's
contextInitialized method, do

System.setProperty("log4j.configuratorClass",
"mypackage.MyConfigurator");
// Configure log4j
System.setProperty("log4j.configuratorClass", null);

And take the -Dlog4j.configuratorClass out of your java launch options:
only do it dynamically as shown above, and then undo it so other webapps
are not affected.

This is a bit kludgey, as it relies on the fact webapps in tomcat are
initialized in series rather than in parallel.  But I don't see a method
like LogManager#configure(Configurator x, ...) in log4j.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Problems with my classpath?

2004-03-29 Thread Shapira, Yoav

Hi,

>
>If a class itself cannot be found, you will usually get a
>ClassNotFoundException.  You're getting a NoClassDefFoundError
>exception instead, which means that your class was found,
>but one of the classes *it* depends on (i.e. imports)
>can not be found.
>
>
>Was he wrong?

It looks like he's right.  Maybe I just want to forget this fact,
because it's so inconsistent on the part of the JVM (if class A is not
found, throw CNFE, but if class B is not found, throw a
NoClassDefFoundError, arrg).  I just did a simple test to confirm what
he says above is right:

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Problems with my classpath?

2004-03-26 Thread Shapira, Yoav

Hi,
Not quite.  I normally would let this go, but this is such an important
issue and we see so many problems related to it ;)  Additions
interspersed.

>ClassNotFoundException means that you were trying to dynamically load a
>class at runtime using something like
>Class.forName("com.mycompany.MyClass") and the class couldn't be found.

That's one way to get it: another is if the container tries to load a
class and it's not found anywhere on the classpath.

>NoClassDefFoundError can be caused by a couple different things:
>
>1.  An import in the class being loaded cannot be found

No, this is a ClassNotFoundException under nearly all circumstances.
(Used to be ALL circumstances, but with AOP and bytecode manipulation
now you can get really hairy corner cases).

>2.  The class being loaded which existed at compile time is now not
found
>at runtime.

Not quite, and since this is the most common I'll clear it up: a class
matching the fully-qualified class name was found by the classloader,
but does not provide the same interface accessibility as the class by
the same name that was present at compile time.  For example, the class
at runtime is missing a method that was present at compile time, or had
a public method changed to private.  This is what happens, for example,
if you compile classes with the servlet 2.4 API and use a servlet 2.3
jar at runtime.

>A third possibility might be that there are multiple versions of log4j
>being loaded by different classloaders, but I'm not totally confident
that
>I can describe exactly how this results in a NoClassDefFoundError.
>
>If Log4j is actually in this user's classpath, then I would suspect the
>third case.  Yoav, maybe you can explain that third case a bit better
for
>us?

Sure.  And this is general, there's nothing here specific to log4j.
When you have multiple versions of the same libraries (fully-qualified
class names is what matters: jar names do not), the loading order
becomes relevant.  For example, if he has an old copy in
$JAVA_HOME/jre/lib/ext (or any other directory designated as 'endorsed'
in the java command line), and a more recent copy in his webapp's
WEB-INF/lib folder, the older copy will get loaded first by J2EE
containers (and subsets therefore, e.g. servlet containers).  Because he
compiled against the version in WEB-INF/lib, he gets a
NoClassDefFoundError at runtime, as the version he compiled against
doesn't match the version found at runtime.

This is evil in certain ways: for example, it might not be the user who
placed the copy in $JAVA_HOME/jre/lib/ext.  It may have been a sysadmin,
another developer, another user, etc, and now it's forgotten.

The solution is not difficult: carefully scan the entire classpath for
multiple versions of the library that's throwing a NoClassDefFoundError.
Remove all copies except the one you want.  Keep your classpath and
environment as clean as possible, no extra jars.

Sometimes there are complications, such as when users run on a container
that provides a shared classloading facility (JBoss, Tomcat, others).
It is nearly always in the user's best interest to not use this
facility, but instead stick to the specification and bundle all needed
libraries for his/her application in a WAR/EAR file.  Alternatively, the
container should provide documentation regarding loading order and
classloader delegation.

I could go on further into the actual permanent generation meaning of
the NoClassDefFoundError (which is suboptimally named IMHO), but I'll
stop here ;)

Yoav Shapira






This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Problems with my classpath?

2004-03-25 Thread Shapira, Yoav

Hi,

>When i run my application with
>java -classpath  runs well
>
>But when i run normally:
>export CLASSPATH 

So you have an environment-related problem most likely: check the JDK
lib/ext directories.

>Then
>Exception in thread "main" java.lang.NoClassDefFoundError:

If you understand the difference between a NoClassDefFoundError and a
ClassNotFoundException, you'll understand your problem.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



RE: Using my own ThreadGroupRenderer

2004-03-23 Thread Shapira, Yoav

Hi,
ObjectRenderers go with the class hierarchy, so you want to associate
de.bankverlag.core.DBThreadGroupRend with java.lang.ThreadGroup.  I'm
not sure of the syntax (others will pipe up if I'm wrong), but maybe
log4j.renderer.java.lang.ThreadGroup=de.bankverlag.core.DBThreadGroupRen
d will work.

Yoav Shapira
Millennium Research Informatics


>-Original Message-
>From: Extern.Otto [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, March 23, 2004 11:35 AM
>To: [EMAIL PROTECTED]
>Subject: Using my own ThreadGroupRenderer
>
>Hi all!
>
>I need to know how I can use my own ThreadGroupRenderer.
>I want to use the JDBC-Appender, but have Problems with ' (single
quotes)
>in the threadname.  The Threadname comes from bea weblogic.
>
>I need to know how to specify my new Renderer like in my
log4j.properties:
>"log4j.or.renderer.ThreadGroupRenderer=de.bankverlag.core.DBThreadGroup
Rend
>erer"
>This does not work, what would be the correct notation?
>
>Thanks for all your help,
>Tobias Otto
>
>
> my log4j.properties with use of JDBC-Appender
>log4j.rootCategory=DEBUG, CONSOLE, DBAPPENDER
>
>log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
>log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
>log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] [%d] [%t] [%c]
[%M]
>[%m] %n
>
>log4j.appender.DBAPPENDER=org.apache.log4j.jdbc.JDBCAppender
>log4j.appender.DBAPPENDER.layout=org.apache.log4j.PatternLayout
>log4j.appender.DBAPPENDER.driver=COM.ibm.db2.jdbc.app.DB2Driver
>
>log4j.appender.DBAPPENDER.URL=jdbc:db2:ODB
>log4j.appender.DBAPPENDER.user=db2admin
>log4j.appender.DBAPPENDER.password=xx
>log4j.appender.DBAPPENDER.sql=insert into logmessages (pri ,tim, thr,
cls,
>mth, msg) values ('%p','%d','%t','%c','%M','%m')
>log4j.appender.DBAPPENDER.name=DBAppender
>
>log4j.or.renderer.ThreadGroupRenderer=de.bankverlag.core.DBThreadGroupR
ende
>rer
>
>
> the replacement of single to double quotes in my own
>ThreadGroupRenderer
>import org.apache.log4j.or.ThreadGroupRenderer;
>public class DBThreadGroupRenderer extends ThreadGroupRenderer {
>
>   public DBThreadGroupRenderer() {
>   super();
>   }
>
>   public String doRender(Object o)  {
>   return super.doRender(o).replace('\'','\"');
>   }
>}
>--
>
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



  1   2   >