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 Joerg Eggink <eg...@access-sys-eu.com> on 2003/06/05 13:46:50 UTC

Log4j instead of writeTo(System.out)

Dear all

I just started with log4j and realize that is has lot of advantages to
other logging.

Now I want to change my existing web applications to log4j.
So, here is my question:

How can I log for example 
MimeMessage.writeTo(System.out) with log4j into a file.

I tried already
Log.info(MimeMessage.getContent ()) but it doesn't work.

Any ideas ?

Thanks in advance for you help

Joerg


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j instead of writeTo(System.out)

Posted by Lukas Hazlehurst <lu...@xtra.co.nz>.
Hello,

Perhaps you could try using the ObjectRenderer to provide a specific way of
rendering MimeMessage objects, then you could just do logger.info(
mime_message ) i believe. BTW I haven't tried this approach yet myself, so i
apologise if i've gotten it mixed up.

http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/or/ObjectRenderer.
html

Lukas

> -----Original Message-----
> From: Joerg Eggink [mailto:eggink@access-sys-eu.com]
> Sent: Thursday, 5 June 2003 11:47 p.m.
> To: log4j-user@jakarta.apache.org
> Subject: Log4j instead of writeTo(System.out)
>
>
> Dear all
>
> I just started with log4j and realize that is has lot of advantages to
> other logging.
>
> Now I want to change my existing web applications to log4j.
> So, here is my question:
>
> How can I log for example
> MimeMessage.writeTo(System.out) with log4j into a file.
>
> I tried already
> Log.info(MimeMessage.getContent ()) but it doesn't work.
>
> Any ideas ?
>
> Thanks in advance for you help
>
> Joerg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.487 / Virus Database: 286 - Release Date: 1/06/2003
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.487 / Virus Database: 286 - Release Date: 1/06/2003


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Packaging of Modified Log4j Classes and Creating a new jar

Posted by Ceki Gülcü <ce...@qos.ch>.
Shailesh,

Interesting question. As far as I know, per clauses 4 and 5 of the
Apache license, and it's log4j variant, you cannot call your modified
product log4j nor can you suggest that the modified product is
endorsed by the Apache Software Foundation or the Jakarta project,
without prior written permission of the foundation.

I suggest that you rename the log4j-1.2.x.jar file to something else,
so that is it clear that your version is distinct from the official
distribution. Thus, you should be (imho) correctly observing the terms
of the Apache License.

You should take the above remarks with a grain of salt. First,
although an ASF member, I am *not* an ASF officer. Second, the above
remarks are my personal understanding of the Apache Software License
and do not officially engage the ASF.

HTH,


At 06:55 PM 6/5/2003 +0530, you wrote:
>Hello,
>
>We are using the Composite Rolling Appender by Kevin Steppe in our
>application for our logging needs . We have also modified the
>PropertyConfigurator class.
>
>
>Can we create a new jar with a different name and package it with our
>new application.
>
>Will we be violating the licensing  policy of Log4J , if we package the
>new jar with our application.
>
>
>Regards
>
>Shailesh

--
Ceki  For log4j documentation consider "The complete log4j manual"
       ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


RE: Log4j instead of writeTo(System.out)

Posted by Joerg Eggink <eg...@access-sys-eu.com>.
Dear Lukas

Thanks for the help.
Seems your Idea can be a solution (Thanks Ceki Gülcü)
Can explain a bit more your idea ?

May be an abstract example of source code can explain.

My problem is I´m not only new to log4j even almost new to Java.
So if you have some more information this would be very nice.

Best Regards

Joerg

> -----Original Message-----
> From: Ceki Gülcü [mailto:ceki@qos.ch] 
> Sent: Thursday, June 05, 2003 2:53 PM
> To: Log4J Users List
> Subject: Re: Log4j instead of writeTo(System.out) 
> 
> 
> 
> MimeMessage specific ObjectRenderer is probably the best solution.
> 
> At 01:46 PM 6/5/2003 +0200, you wrote:
> >Dear all
> >
> >I just started with log4j and realize that is has lot of 
> advantages to 
> >other logging.
> >
> >Now I want to change my existing web applications to log4j. 
> So, here is 
> >my question:
> >
> >How can I log for example
> >MimeMessage.writeTo(System.out) with log4j into a file.
> >
> >I tried already
> >Log.info(MimeMessage.getContent ()) but it doesn't work.
> >
> >Any ideas ?
> >
> >Thanks in advance for you help
> >
> >Joerg
> 
> --
> Ceki  For log4j documentation consider "The complete log4j manual"
>        ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Packaging of Modified Log4j Classes and Creating a new jar

Posted by Shailesh Vaidya <Sh...@Yojna.com>.
Hello,

We are using the Composite Rolling Appender by Kevin Steppe in our
application for our logging needs . We have also modified the
PropertyConfigurator class.


Can we create a new jar with a different name and package it with our
new application.

Will we be violating the licensing  policy of Log4J , if we package the
new jar with our application.


Regards

Shailesh


-----Original Message-----
From: Ceki Gülcü [mailto:ceki@qos.ch] 
Sent: Thursday, June 05, 2003 6:23 PM
To: Log4J Users List
Subject: Re: Log4j instead of writeTo(System.out) 


MimeMessage specific ObjectRenderer is probably the best solution.

At 01:46 PM 6/5/2003 +0200, you wrote:
>Dear all
>
>I just started with log4j and realize that is has lot of advantages to
>other logging.
>
>Now I want to change my existing web applications to log4j.
>So, here is my question:
>
>How can I log for example
>MimeMessage.writeTo(System.out) with log4j into a file.
>
>I tried already
>Log.info(MimeMessage.getContent ()) but it doesn't work.
>
>Any ideas ?
>
>Thanks in advance for you help
>
>Joerg

--
Ceki  For log4j documentation consider "The complete log4j manual"
       ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Log4j instead of writeTo(System.out)

Posted by Ceki Gülcü <ce...@qos.ch>.
MimeMessage specific ObjectRenderer is probably the best solution.

At 01:46 PM 6/5/2003 +0200, you wrote:
>Dear all
>
>I just started with log4j and realize that is has lot of advantages to
>other logging.
>
>Now I want to change my existing web applications to log4j.
>So, here is my question:
>
>How can I log for example
>MimeMessage.writeTo(System.out) with log4j into a file.
>
>I tried already
>Log.info(MimeMessage.getContent ()) but it doesn't work.
>
>Any ideas ?
>
>Thanks in advance for you help
>
>Joerg

--
Ceki  For log4j documentation consider "The complete log4j manual"
       ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org