You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by toffeemak <to...@hotmail.com> on 2002/08/17 12:54:17 UTC

Newbie questions

Hi,

I am a newbie of log4j.

1. I would like to log the messages to NT event log. I know that the 
log4j package come with a dll file. I tried to use it. But I find 
that the Source is always "log4j", Type is "Error", Category 
is "4096". How can I change these values(Type, Source, Category, 
Event and User)?

2. When should I use NDC/MDC? 

3. When should I use filter? 

4. I am gonna to buy the complete manual of log4j. Would like to get 
some feedbacks on it.

5. I have an application, I would like to log the fatal errors to nt 
event log and the all the warning messages and fatal messages store 
in a file. Should I define as follow?

log4j.rootLogger = FATAL, A1
log4j.rootLogger = WARN, A2

where A1 is nt event appender
where A2 is daily rolling appender

6. I have a few web applications running in a JVM. Can each 
application has their own log4j properties files? 

Thanks in advance.

Fanny



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Newbie questions - NT Event log

Posted by toffeemak <to...@hotmail.com>.
HI, 

Thanks for your reply. Actually, I am able to log the message to NT 
event log. But the values in Type, Source, Category, Event and User 
columns on Event Log viewer are always the same. Seems that the log4j 
api only able to change the message. Since my applications need to 
have different values for those columns. Any idea how to do it?

Regards,

Fanny
--- In Log4J@y..., "Colin MacDonald" <co...@t...> wrote:
> 'Fraid I can't answer all your questions, but I'll do the ones I 
can.  I
> tried out NT event logging a while ago, so I've gotten it working, 
but my
> memory is a little fuzzy on the subject.
> 
> > -----Original Message-----
> >
> > 1. I would like to log the messages to NT event log. I know that 
the
> > log4j package come with a dll file. I tried to use it. But I find
> > that the Source is always "log4j", Type is "Error", Category
> > is "4096". How can I change these values(Type, Source, Category,
> > Event and User)?
> 
> That sounds like an error in configuring the appender.  Check that 
the
> directory with the .dll file is on your Windows path, and see the 
config
> remarks below.
> 
> > 5. I have an application, I would like to log the fatal errors to 
nt
> > event log and the all the warning messages and fatal messages 
store
> > in a file. Should I define as follow?
> >
> > log4j.rootLogger = FATAL, A1
> > log4j.rootLogger = WARN, A2
> >
> > where A1 is nt event appender
> > where A2 is daily rolling appender
> 
> I think that should be:
> 
>   log4j.rootLogger = WARN, A1, A2
>   log4j.appender.A1.threshold=FATAL
> 
> Hope that helps!
> 
> -----------------------------------------------------------------
> Colin MacDonald  |  Software Developer  |  Templar Corporation  |
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@j...>
> For additional commands, e-mail: <ma...@j...>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Newbie questions

Posted by Colin MacDonald <co...@templarcorp.com>.
'Fraid I can't answer all your questions, but I'll do the ones I can.  I
tried out NT event logging a while ago, so I've gotten it working, but my
memory is a little fuzzy on the subject.

> -----Original Message-----
>
> 1. I would like to log the messages to NT event log. I know that the
> log4j package come with a dll file. I tried to use it. But I find
> that the Source is always "log4j", Type is "Error", Category
> is "4096". How can I change these values(Type, Source, Category,
> Event and User)?

That sounds like an error in configuring the appender.  Check that the
directory with the .dll file is on your Windows path, and see the config
remarks below.

> 5. I have an application, I would like to log the fatal errors to nt
> event log and the all the warning messages and fatal messages store
> in a file. Should I define as follow?
>
> log4j.rootLogger = FATAL, A1
> log4j.rootLogger = WARN, A2
>
> where A1 is nt event appender
> where A2 is daily rolling appender

I think that should be:

  log4j.rootLogger = WARN, A1, A2
  log4j.appender.A1.threshold=FATAL

Hope that helps!

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>