named logger .

2007-03-07 Thread Asif Mekrani

Hi Group,

Please can you tell me how to use the names logger. means :

Usually we use a class name for the logger name, eg:

private static Log logger = LogFactory.getLog(MyClass.class);

but wat if, I want to use a string name instead of the class name , i.e.

private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");

and how to specify the same in the log4J.xml file.

TIA.

Smiles,
Asif


Re: log4J MDC

2007-03-07 Thread Asif Mekrani

Hi James,

I found the way,

It is %X{parameterKey1} %X{parameterKey2} %X{parameterKey3}.

-Asif

On 3/6/07, James Stauffer <[EMAIL PROTECTED]> wrote:


According to the javadocs there isn't a way to print everything.  You
must list every key.

On 3/6/07, Asif Mekrani <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> How can i print all the parameter in the MDC. I try some thing like this
in
> my log4J file:
>
> %X{parameterKey} and this gets print. but, when i want to print more
than
> one parameter how should it. can some body tell me the syntax.
>
> Thanks in advance.
>
> Smiles,
> Asif
>


--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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




Re: named logger .

2007-03-07 Thread James Stauffer

private static Log logger = LogFactory.getLog(MyClass.class);

That will produce a logger named after the fully qualified name of the
class (i.e. "com.acme.project.MyClass")


private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");

That will produce a logger named exactly "MY_LOGGER_NAME"


and how to specify the same in the log4J.xml file.

Examples:
 
 


On 3/7/07, Asif Mekrani <[EMAIL PROTECTED]> wrote:

Hi Group,

Please can you tell me how to use the names logger. means :

Usually we use a class name for the logger name, eg:

private static Log logger = LogFactory.getLog(MyClass.class);

but wat if, I want to use a string name instead of the class name , i.e.

private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");

and how to specify the same in the log4J.xml file.

TIA.

Smiles,
Asif




--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



Re: log4J MDC

2007-03-07 Thread James Stauffer

You are correct.  I thought you were asking to do something like %X to
have everything printed without specifing each key. :-)

On 3/7/07, Asif Mekrani <[EMAIL PROTECTED]> wrote:

Hi James,

I found the way,

It is %X{parameterKey1} %X{parameterKey2} %X{parameterKey3}.

-Asif

On 3/6/07, James Stauffer <[EMAIL PROTECTED]> wrote:
>
> According to the javadocs there isn't a way to print everything.  You
> must list every key.
>
> On 3/6/07, Asif Mekrani <[EMAIL PROTECTED]> wrote:
> > Hi All,
> >
> > How can i print all the parameter in the MDC. I try some thing like this
> in
> > my log4J file:
> >
> > %X{parameterKey} and this gets print. but, when i want to print more
> than
> > one parameter how should it. can some body tell me the syntax.
> >
> > Thanks in advance.
> >
> > Smiles,
> > Asif
> >
>
>
> --
> James Staufferhttp://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>




--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



Appender - number of lines

2007-03-07 Thread DECAFFMEYER MATHIEU

Hi,

My application allows to index a web application,
and I want to show on a jsp the last time the specified web applciation
has been indexed,
like :
8 March 12 PM 32 - Full index
7 March 15 PM 46 - Partial index
etc.

So I need to get the X first lines I store.

I don't know if it is a good idea to use log4j for this,
Unfortunately there is no appender that roll the file after X lines.

Thank u for any suggestions.


__
   Matt




Internet communications are not secure and therefore Fortis Banque Luxembourg 
S.A. does not accept legal responsibility for the contents of this message. The 
information contained in this e-mail is confidential and may be legally 
privileged. It is intended solely for the addressee. If you are not the 
intended recipient, any disclosure, copying, distribution or any action taken 
or omitted to be taken in reliance on it, is prohibited and may be unlawful. 
Nothing in the message is capable or intended to create any legally binding 
obligations on either party and it is not intended to provide legal advice.


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

Re: named logger .

2007-03-07 Thread Jacob Kjome
Quoting Asif Mekrani <[EMAIL PROTECTED]>:

> Hi Group,
>
> Please can you tell me how to use the names logger. means :
>
> Usually we use a class name for the logger name, eg:
>
> private static Log logger = LogFactory.getLog(MyClass.class);
>
> but wat if, I want to use a string name instead of the class name , i.e.
>
> private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");
>
> and how to specify the same in the log4J.xml file.
>


...



Jake

> TIA.
>
> Smiles,
> Asif
>




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



Re: Appender - number of lines

2007-03-07 Thread James Stauffer

You could have your indexing class keep two static variables with the
times of the last full and partial index.

On 3/7/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:





Hi,

My application allows to index a web application,
and I want to show on a jsp the last time the specified web applciation has
been indexed,
like :
8 March 12 PM 32 - Full index
7 March 15 PM 46 - Partial index
etc.

So I need to get the X first lines I store.

I don't know if it is a good idea to use log4j for this,
Unfortunately there is no appender that roll the file after X lines.

Thank u for any suggestions.


__
   Matt

 
 Internet communications are not secure and therefore Fortis Banque
Luxembourg S.A. does not accept legal responsibility for the contents of
this message. The information contained in this e-mail is confidential and
may be legally privileged. It is intended solely for the addressee. If you
are not the intended recipient, any disclosure, copying, distribution or any
action taken or omitted to be taken in reliance on it, is prohibited and may
be unlawful. Nothing in the message is capable or intended to create any
legally binding obligations on either party and it is not intended to
provide legal advice.
 

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




--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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



RE: Appender - number of lines

2007-03-07 Thread DECAFFMEYER MATHIEU
Ok, I need a list of the last indexed times but that way a List is also
possible.
But if application shuts down I lose the information ...
Well if there is no simple way, I'll just keep the information in memory
like u suggested, 
Thank u
__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 07, 2007 5:30 PM
To: Log4J Users List
Subject: Re: Appender - number of lines

*  This message comes from the Internet Network *

You could have your indexing class keep two static variables with the
times of the last full and partial index.

On 3/7/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi,
>
> My application allows to index a web application,
> and I want to show on a jsp the last time the specified web
applciation has
> been indexed,
> like :
> 8 March 12 PM 32 - Full index
> 7 March 15 PM 46 - Partial index
> etc.
>
> So I need to get the X first lines I store.
>
> I don't know if it is a good idea to use log4j for this,
> Unfortunately there is no appender that roll the file after X lines.
>
> Thank u for any suggestions.
>
>
> __
>Matt
>
>  
>  Internet communications are not secure and therefore Fortis Banque
> Luxembourg S.A. does not accept legal responsibility for the contents
of
> this message. The information contained in this e-mail is confidential
and
> may be legally privileged. It is intended solely for the addressee. If
you
> are not the intended recipient, any disclosure, copying, distribution
or any
> action taken or omitted to be taken in reliance on it, is prohibited
and may
> be unlawful. Nothing in the message is capable or intended to create
any
> legally binding obligations on either party and it is not intended to
> provide legal advice.
>  
>
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


-- 
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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




Internet communications are not secure and therefore Fortis Banque Luxembourg 
S.A. does not accept legal responsibility for the contents of this message. The 
information contained in this e-mail is confidential and may be legally 
privileged. It is intended solely for the addressee. If you are not the 
intended recipient, any disclosure, copying, distribution or any action taken 
or omitted to be taken in reliance on it, is prohibited and may be unlawful. 
Nothing in the message is capable or intended to create any legally binding 
obligations on either party and it is not intended to provide legal advice.



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



Re: Appender - number of lines

2007-03-07 Thread James Stauffer

The only ideas I have for looking in the logs is to call out to grep.

On 3/7/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:

Ok, I need a list of the last indexed times but that way a List is also
possible.
But if application shuts down I lose the information ...
Well if there is no simple way, I'll just keep the information in memory
like u suggested,
Thank u
__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 5:30 PM
To: Log4J Users List
Subject: Re: Appender - number of lines

*  This message comes from the Internet Network *

You could have your indexing class keep two static variables with the
times of the last full and partial index.

On 3/7/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi,
>
> My application allows to index a web application,
> and I want to show on a jsp the last time the specified web
applciation has
> been indexed,
> like :
> 8 March 12 PM 32 - Full index
> 7 March 15 PM 46 - Partial index
> etc.
>
> So I need to get the X first lines I store.
>
> I don't know if it is a good idea to use log4j for this,
> Unfortunately there is no appender that roll the file after X lines.
>
> Thank u for any suggestions.
>
>
> __
>Matt
>
>  
>  Internet communications are not secure and therefore Fortis Banque
> Luxembourg S.A. does not accept legal responsibility for the contents
of
> this message. The information contained in this e-mail is confidential
and
> may be legally privileged. It is intended solely for the addressee. If
you
> are not the intended recipient, any disclosure, copying, distribution
or any
> action taken or omitted to be taken in reliance on it, is prohibited
and may
> be unlawful. Nothing in the message is capable or intended to create
any
> legally binding obligations on either party and it is not intended to
> provide legal advice.
>  
>
> -
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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




Internet communications are not secure and therefore Fortis Banque Luxembourg 
S.A. does not accept legal responsibility for the contents of this message. The 
information contained in this e-mail is confidential and may be legally 
privileged. It is intended solely for the addressee. If you are not the 
intended recipient, any disclosure, copying, distribution or any action taken 
or omitted to be taken in reliance on it, is prohibited and may be unlawful. 
Nothing in the message is capable or intended to create any legally binding 
obligations on either party and it is not intended to provide legal advice.



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





--
James Staufferhttp://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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