Chainsaw and VFS XML Layout

2007-02-28 Thread Jeff Longland

I was just wondering if there's a VFS receiver that supports XMLLayout?

Thanks!
Jeff

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



Re: Using XMLLayout..

2007-02-28 Thread Curt Arnold

From a previous time the question was asked:


On Jan 11, 2007, at 4:27 PM, Curt Arnold wrote:


log4j doesn't actually produce an XML document since an XML  
document can only have one element.  log4j produces an XML parsed  
entity (in this case a sequence of elements) that can be referenced  
in an XML document and it is assumed that the containing document  
would declare the namespace prefix.  To process the output of log4j  
by XSLT, you would need to create a small XML document that  
includes the log file and then process the XML document using XSLT.


Your XML document would look like:


]>

&logfile;





Question comes up enough that there should be a FAQ on it and check  
that the documentation mentions it.




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



Re: Using XMLLayout..

2007-02-28 Thread James Stauffer

Since the file is continuously changed it wouldn't be possible to have
a root element unless it is added as it is rolled.

On 2/28/07, Madduri, Murthy <[EMAIL PROTECTED]> wrote:

Hi,



As a part of our J2EE application, we need to build a custom Layout for
the logging event. The generated log file is expected to be very large.

The custom layout need not to conform to any DTD, but, needs to be a
well-formed XML with the root element.

I am using XPath expression on the XML string to get the proper output.



Right now, I have extended the Layout class to generate the output using
brute StringBuffer append method.

When I am trying to transform this file (which is not a well-formed
XML), the transformer complains that it is missing the root element.

Is it a better idea to tweak the XMLLayout to fit-in the custom content?



Here is a sample of the content that is in the log file:

myHostResponse

myHost1FAIL

myHost2Unknown



If I can get this with a root element, the transformer works fine.





myHostResponse

myHost1FAIL

myHost2Unknown





I appreciate any help on this.



Thanks & Regards,

Murthy Madduri

*(770)263-1231

*Email:[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]



Using XMLLayout..

2007-02-28 Thread Madduri, Murthy
Hi,

 

As a part of our J2EE application, we need to build a custom Layout for
the logging event. The generated log file is expected to be very large.

The custom layout need not to conform to any DTD, but, needs to be a
well-formed XML with the root element.

I am using XPath expression on the XML string to get the proper output.

 

Right now, I have extended the Layout class to generate the output using
brute StringBuffer append method.

When I am trying to transform this file (which is not a well-formed
XML), the transformer complains that it is missing the root element.

Is it a better idea to tweak the XMLLayout to fit-in the custom content?

 

Here is a sample of the content that is in the log file:

myHostResponse 

myHost1FAIL

myHost2Unknown

 

If I can get this with a root element, the transformer works fine.

 



myHostResponse 

myHost1FAIL

myHost2Unknown



 

I appreciate any help on this.

 

Thanks & Regards,

Murthy Madduri

*(770)263-1231

*Email:[EMAIL PROTECTED]  

 

 



RE: Multiple logging files

2007-02-28 Thread DECAFFMEYER MATHIEU
Ok,
after having set the new system property to change dynamically of
location for the logs,
I reload the config,

System.setProperty("log.name","idRequest+".log");
DOMConfigurator.configure(AppConfigManager.PATH_TO_LOGS+"log4j.xml"); 


Thank u for your support:-)
__
   Matt



-Original Message-
From: DECAFFMEYER MATHIEU [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 3:09 PM
To: Log4J Users List
Subject: RE: Multiple logging files

*  This message comes from the Internet Network *

Ok,

I have set the system property before to initializing log4j

(just as test :
System.setProperty("log.name","temp.log");
DOMConfigurator.configure(PATH_TO_LOGS+"log4j.xml");
)

Then I change dynamically the system property to change the directory in
which the logs need to be stored :
System.setProperty("log.name",idRequest+".log");

But the logs keeps getting stored in temp.log 

__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 2:14 PM
To: Log4J Users List
Subject: Re: Multiple logging files

*  This message comes from the Internet Network *

3. Both the system property and any needed directories need to be set
before log4j is configured.  I created an appender that can create
directories as needed and it is at
http://stauffer.james.googlepages.com/DateFormatFileAppender.java

4. In your code you don't refer to a special appender, you refer to
special loggers.
i.e
Logger logger = Logger.getLogger(getClass().getName());
Logger specialLogger = Logger.getLogger("special." +
getClass().getName());

  


  

  



  

On 2/28/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> For the System property issue I tried this :
>
>class="org.apache.log4j.DailyRollingFileAppender">
>   
>value="C:/UserTemp/matthew016/${log.name}"/>
>   
>
>   
>   
>
> And in my Java applciation I execute this line before I need to log in
> the special appender :
>
> System.setProperty("log.name",idRequest+".log");
>
> [2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R log4j:ERROR
> setFile(null,true) call failed.
> [2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R
> java.io.FileNotFoundException: C:\UserTemp\matthew016 (Access is
denied)
>
> Though something like this  value="C:/UserTemp/matthew016/myLog.log"/> works.
>
> I tried also a simple thing :
> If I do this :
> 
>
> [2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R log4j:ERROR
> setFile(null,true) call failed.
> [2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R
> java.io.FileNotFoundException: C:\UserTemp\matthew016\updates\test.log
> (The system cannot find the path specified)
>
> It gives me the same error, because it cannot find the directory
> "updates" under dir "matthew016".
> Though I create this dir dynamically in my application *before* any
logs
> need to be stored trhough the appender specified output.
>
> __
>Matt
>
>
>
> -Original Message-
> From: DECAFFMEYER MATHIEU [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 28, 2007 9:58 AM
> To: Log4J Users List
> Subject: RE: Multiple logging files
>
> *  This message comes from the Internet Network *
>
> Yes exactly  :-) Thank u very much,
> I realized I did this all wrong.
>
> I have read the Log4J tutorial,
>
> I did the points 1 & 2, but for I have some difficulties on how to
> implement point 3 & 4
>
> I switched this to XML :
>
>class="org.apache.log4j.FileAppender">
>
>
>
>
>
>   
>class="org.apache.log4j.FileAppender">
>   
>   
>   
>   
>
>   
>   
>class="org.apache.log4j.ConsoleAppender">
>   
> />
>   
>   
>   
> 
> 
> 
> 
>   
>
>
> *  In my Java class I don't know how I can specify which appender I
> should use,
>Or maybe I can specify the logger in the log4j.xml file ?
>
> *  I don't knwo how to use the system property,
>In the program I suppose I just need to do something like this :
> System.setProperty("myProp","updates/"+dirNumber);
>But what do I need to specify in the XML file ?
>
> *  Is it correct what I did in the special appender ? I specified the
> file which must include the system property and the same file as the
> main appender,
>is this the good way.
>
>
> Thank u for any hints!
>
> __
>Matt
>
>
>
> -Original Message-
> From: James Stauffer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 27, 2007 5:47 PM
> To: Log4J Users List
> Subject: Re: Multiple logging files
>
> *  This message comes from the Inter

Re: Root logger appenders in log4j 1.3

2007-02-28 Thread James Stauffer

You can use code to remove all appenders.

On 2/28/07, Sergiu Bivol <[EMAIL PROTECTED]> wrote:

Anyone? Please advice on the configuration scenario in the previous message.


In short, we'd like to log messages in a certain way (specified in a
log4j.xml internal to our jar) when our app boots, and then at normal
runtime log messages as configured by the user in an external log4j.xml.

At this point, we can't find a way to override boot-time log4j configuration
with log4j 1.3.

Thank you

-Original Message-
From: Sergiu Bivol [mailto:[EMAIL PROTECTED]
Sent: February 23, 2007 3:20 PM
To: 'Log4J Users List'
Subject: RE: Root logger appenders in log4j 1.3

Hi,

Yes, perhaps there are reasons to change it, but then help me understand how
to configure log4j in the following scenario.

We provide a log4.xml within our app's jar so that our application logs
messages during startup (say to file1 and console). We also let the users
specify a separate (external to our jars) log4j xml file to configure how
the app should log messages after the startup phase (say file2 and console).

With 1.2, this could be done by attaching the corresponding 2 appenders to
the  element in each of the config files. How would I achieve the same
behavior in 1.3? At this point, both file1 and file2 are growing, and every
message is showing twice on the console.

Thank you
Sergiu

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]
Sent: February 23, 2007 2:49 PM
To: Log4J Users List; Log4J Users List
Subject: Re: Root logger appenders in log4j 1.3


Hello Jake et al,

The complete log4j manual is correct as far as log4j 1.0, 1.1, 1.2 are
concerned. However, in log4j 1.3 the behavior was changed because:

1) it is not what a user would expect without reading the docs (surprise
element)
2) very few people seemed to take advantage of the "pre 1.3" behaviour**

** The "pre 1.3" behavior was intended to support partial config files

The different behaviors should be transparent to the user as long as she
does not do partial configs.

I hope this helps,

At 06:15 AM 2/23/2007, Jacob Kjome wrote:

>That's an interesting quote.  I have to admit that I haven't read the
>Log4j manual and that's new to me.  In Log4j, reconfigurations are
>genrally not destructive.  They are cumulative.  It sounds like the manual
>is claiming that the ROOT logger is an exception to the rule.
>
>Have you tried this with Log4j-1.2.xx?  Do you get the same results or do
>you get the behavior described in the manual?  It's certainly possible
>that this contract was broken in 1.3.
>
>Ceki, Curt, anyone, can you shed any light on this topic?  What's the
>expected behavior?  Is the manual right, wrong, or just being
misinterpreted?
>
>
>Jake

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for
Java.
http://logback.qos.ch


-
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]





--
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: Multiple logging files

2007-02-28 Thread DECAFFMEYER MATHIEU
Ok,

I have set the system property before to initializing log4j

(just as test :
System.setProperty("log.name","temp.log");
DOMConfigurator.configure(PATH_TO_LOGS+"log4j.xml");
)

Then I change dynamically the system property to change the directory in
which the logs need to be stored :
System.setProperty("log.name",idRequest+".log");

But the logs keeps getting stored in temp.log 

__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 2:14 PM
To: Log4J Users List
Subject: Re: Multiple logging files

*  This message comes from the Internet Network *

3. Both the system property and any needed directories need to be set
before log4j is configured.  I created an appender that can create
directories as needed and it is at
http://stauffer.james.googlepages.com/DateFormatFileAppender.java

4. In your code you don't refer to a special appender, you refer to
special loggers.
i.e
Logger logger = Logger.getLogger(getClass().getName());
Logger specialLogger = Logger.getLogger("special." +
getClass().getName());

  


  

  



  

On 2/28/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> For the System property issue I tried this :
>
>class="org.apache.log4j.DailyRollingFileAppender">
>   
>value="C:/UserTemp/matthew016/${log.name}"/>
>   
>
>   
>   
>
> And in my Java applciation I execute this line before I need to log in
> the special appender :
>
> System.setProperty("log.name",idRequest+".log");
>
> [2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R log4j:ERROR
> setFile(null,true) call failed.
> [2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R
> java.io.FileNotFoundException: C:\UserTemp\matthew016 (Access is
denied)
>
> Though something like this  value="C:/UserTemp/matthew016/myLog.log"/> works.
>
> I tried also a simple thing :
> If I do this :
> 
>
> [2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R log4j:ERROR
> setFile(null,true) call failed.
> [2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R
> java.io.FileNotFoundException: C:\UserTemp\matthew016\updates\test.log
> (The system cannot find the path specified)
>
> It gives me the same error, because it cannot find the directory
> "updates" under dir "matthew016".
> Though I create this dir dynamically in my application *before* any
logs
> need to be stored trhough the appender specified output.
>
> __
>Matt
>
>
>
> -Original Message-
> From: DECAFFMEYER MATHIEU [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 28, 2007 9:58 AM
> To: Log4J Users List
> Subject: RE: Multiple logging files
>
> *  This message comes from the Internet Network *
>
> Yes exactly  :-) Thank u very much,
> I realized I did this all wrong.
>
> I have read the Log4J tutorial,
>
> I did the points 1 & 2, but for I have some difficulties on how to
> implement point 3 & 4
>
> I switched this to XML :
>
>class="org.apache.log4j.FileAppender">
>
>
>
>
>
>   
>class="org.apache.log4j.FileAppender">
>   
>   
>   
>   
>
>   
>   
>class="org.apache.log4j.ConsoleAppender">
>   
> />
>   
>   
>   
> 
> 
> 
> 
>   
>
>
> *  In my Java class I don't know how I can specify which appender I
> should use,
>Or maybe I can specify the logger in the log4j.xml file ?
>
> *  I don't knwo how to use the system property,
>In the program I suppose I just need to do something like this :
> System.setProperty("myProp","updates/"+dirNumber);
>But what do I need to specify in the XML file ?
>
> *  Is it correct what I did in the special appender ? I specified the
> file which must include the system property and the same file as the
> main appender,
>is this the good way.
>
>
> Thank u for any hints!
>
> __
>Matt
>
>
>
> -Original Message-
> From: James Stauffer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 27, 2007 5:47 PM
> To: Log4J Users List
> Subject: Re: Multiple logging files
>
> *  This message comes from the Internet Network *
>
> This should do what you want:
> 1. Switch to XML config.
> 2. Define your main appender and special appender
> 3. Use a system property for the name of the file in the special
> appender.
> 4. Make sure you have your loggers setup so logs from the special part
> of your code go to the special appender.
>
> On 2/27/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> > Thanks for your response,
> > it's not exactly what I want actually :
> >
> > I have a main log where every log is stored,
> > But in a part of my code I want to log in a sepa

RE: Root logger appenders in log4j 1.3

2007-02-28 Thread Sergiu Bivol
Anyone? Please advice on the configuration scenario in the previous message.


In short, we'd like to log messages in a certain way (specified in a
log4j.xml internal to our jar) when our app boots, and then at normal
runtime log messages as configured by the user in an external log4j.xml. 

At this point, we can't find a way to override boot-time log4j configuration
with log4j 1.3.

Thank you

-Original Message-
From: Sergiu Bivol [mailto:[EMAIL PROTECTED] 
Sent: February 23, 2007 3:20 PM
To: 'Log4J Users List'
Subject: RE: Root logger appenders in log4j 1.3

Hi,

Yes, perhaps there are reasons to change it, but then help me understand how
to configure log4j in the following scenario.

We provide a log4.xml within our app's jar so that our application logs
messages during startup (say to file1 and console). We also let the users
specify a separate (external to our jars) log4j xml file to configure how
the app should log messages after the startup phase (say file2 and console).

With 1.2, this could be done by attaching the corresponding 2 appenders to
the  element in each of the config files. How would I achieve the same
behavior in 1.3? At this point, both file1 and file2 are growing, and every
message is showing twice on the console.

Thank you
Sergiu

-Original Message-
From: Ceki Gülcü [mailto:[EMAIL PROTECTED] 
Sent: February 23, 2007 2:49 PM
To: Log4J Users List; Log4J Users List
Subject: Re: Root logger appenders in log4j 1.3


Hello Jake et al,

The complete log4j manual is correct as far as log4j 1.0, 1.1, 1.2 are 
concerned. However, in log4j 1.3 the behavior was changed because:

1) it is not what a user would expect without reading the docs (surprise 
element)
2) very few people seemed to take advantage of the "pre 1.3" behaviour**

** The "pre 1.3" behavior was intended to support partial config files

The different behaviors should be transparent to the user as long as she 
does not do partial configs.

I hope this helps,

At 06:15 AM 2/23/2007, Jacob Kjome wrote:

>That's an interesting quote.  I have to admit that I haven't read the 
>Log4j manual and that's new to me.  In Log4j, reconfigurations are 
>genrally not destructive.  They are cumulative.  It sounds like the manual 
>is claiming that the ROOT logger is an exception to the rule.
>
>Have you tried this with Log4j-1.2.xx?  Do you get the same results or do 
>you get the behavior described in the manual?  It's certainly possible 
>that this contract was broken in 1.3.
>
>Ceki, Curt, anyone, can you shed any light on this topic?  What's the 
>expected behavior?  Is the manual right, wrong, or just being
misinterpreted?
>
>
>Jake

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for
Java.
http://logback.qos.ch


-
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: Multiple logging files

2007-02-28 Thread James Stauffer

3. Both the system property and any needed directories need to be set
before log4j is configured.  I created an appender that can create
directories as needed and it is at
http://stauffer.james.googlepages.com/DateFormatFileAppender.java

4. In your code you don't refer to a special appender, you refer to
special loggers.
i.e
Logger logger = Logger.getLogger(getClass().getName());
Logger specialLogger = Logger.getLogger("special." + getClass().getName());

 
   
   
 

 
   
   
   
 

On 2/28/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:

For the System property issue I tried this :

  
  
  
  
   
  
  

And in my Java applciation I execute this line before I need to log in
the special appender :

System.setProperty("log.name",idRequest+".log");

[2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R log4j:ERROR
setFile(null,true) call failed.
[2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R
java.io.FileNotFoundException: C:\UserTemp\matthew016 (Access is denied)

Though something like this  works.

I tried also a simple thing :
If I do this :


[2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R log4j:ERROR
setFile(null,true) call failed.
[2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R
java.io.FileNotFoundException: C:\UserTemp\matthew016\updates\test.log
(The system cannot find the path specified)

It gives me the same error, because it cannot find the directory
"updates" under dir "matthew016".
Though I create this dir dynamically in my application *before* any logs
need to be stored trhough the appender specified output.

__
   Matt



-Original Message-
From: DECAFFMEYER MATHIEU [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 28, 2007 9:58 AM
To: Log4J Users List
Subject: RE: Multiple logging files

*  This message comes from the Internet Network *

Yes exactly  :-) Thank u very much,
I realized I did this all wrong.

I have read the Log4J tutorial,

I did the points 1 & 2, but for I have some difficulties on how to
implement point 3 & 4

I switched this to XML :

  
   
   
   
   
   
  
  
  
  
  
  
   
  
  
  
  
   
  
  
  




  


*  In my Java class I don't know how I can specify which appender I
should use,
   Or maybe I can specify the logger in the log4j.xml file ?

*  I don't knwo how to use the system property,
   In the program I suppose I just need to do something like this :
System.setProperty("myProp","updates/"+dirNumber);
   But what do I need to specify in the XML file ?

*  Is it correct what I did in the special appender ? I specified the
file which must include the system property and the same file as the
main appender,
   is this the good way.


Thank u for any hints!

__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 5:47 PM
To: Log4J Users List
Subject: Re: Multiple logging files

*  This message comes from the Internet Network *

This should do what you want:
1. Switch to XML config.
2. Define your main appender and special appender
3. Use a system property for the name of the file in the special
appender.
4. Make sure you have your loggers setup so logs from the special part
of your code go to the special appender.

On 2/27/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> Thanks for your response,
> it's not exactly what I want actually :
>
> I have a main log where every log is stored,
> But in a part of my code I want to log in a separate file (and still
in
> the main log file),
> the location in which I must store the logs of this block of code
> is told dynamically in my application in a new Log4j file
> (log4j.appender.file.File=).
>
> So in other words each time I execute this block of code I create a
new
> Log4J file because I must specify a new directory where to store the
> logs.
> (e.g. first time I execute the specific block of code store log in
> directory 21456, second time in 14598, ...)
>
> So at the start of this code I do :
> PropertyConfigurator.configure(...);
> To load dynamically a new Log4J file (where the new location in which
I
> store the logs is specified)
>
> But when I execute this, the logs aren't stored anymore in the main
log
> file.
> I tried :
> ApplicationLogManager.info("test1");
> PropertyConfigurator.configure(logConfigFileName);
> ApplicationLogManager.info("test2");
> The main log file displays "test1" but nothing anymore below it.
> That is problem #1.
>
> Then when this block of code is exectued, I want to load again the
main
> Log4j file, in the classpath but I don't know how to load this one
> PropertyConfigurator.configure(?

RE: Multiple logging files

2007-02-28 Thread DECAFFMEYER MATHIEU
For the System property issue I tried this :

  
  
  
  
   
  
  

And in my Java applciation I execute this line before I need to log in
the special appender :

System.setProperty("log.name",idRequest+".log");

[2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R log4j:ERROR
setFile(null,true) call failed.
[2/28/07 12:16:32:297 CET] 3e89f5a2 SystemErr R
java.io.FileNotFoundException: C:\UserTemp\matthew016 (Access is denied)

Though something like this  works.

I tried also a simple thing :
If I do this :


[2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R log4j:ERROR
setFile(null,true) call failed.
[2/28/07 12:15:17:669 CET] 3e8d3584 SystemErr R
java.io.FileNotFoundException: C:\UserTemp\matthew016\updates\test.log
(The system cannot find the path specified)
 
It gives me the same error, because it cannot find the directory
"updates" under dir "matthew016".
Though I create this dir dynamically in my application *before* any logs
need to be stored trhough the appender specified output.

__
   Matt



-Original Message-
From: DECAFFMEYER MATHIEU [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 9:58 AM
To: Log4J Users List
Subject: RE: Multiple logging files

*  This message comes from the Internet Network *

Yes exactly  :-) Thank u very much,
I realized I did this all wrong.

I have read the Log4J tutorial,

I did the points 1 & 2, but for I have some difficulties on how to
implement point 3 & 4

I switched this to XML :

  
   
   
   
   
   
  
  
  
  
  
  
   
  
  
  
  
   
  
  
  




  


*  In my Java class I don't know how I can specify which appender I
should use,
   Or maybe I can specify the logger in the log4j.xml file ?

*  I don't knwo how to use the system property,
   In the program I suppose I just need to do something like this :
System.setProperty("myProp","updates/"+dirNumber);
   But what do I need to specify in the XML file ?

*  Is it correct what I did in the special appender ? I specified the
file which must include the system property and the same file as the
main appender, 
   is this the good way.


Thank u for any hints!

__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 27, 2007 5:47 PM
To: Log4J Users List
Subject: Re: Multiple logging files

*  This message comes from the Internet Network *

This should do what you want:
1. Switch to XML config.
2. Define your main appender and special appender
3. Use a system property for the name of the file in the special
appender.
4. Make sure you have your loggers setup so logs from the special part
of your code go to the special appender.

On 2/27/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> Thanks for your response,
> it's not exactly what I want actually :
>
> I have a main log where every log is stored,
> But in a part of my code I want to log in a separate file (and still
in
> the main log file),
> the location in which I must store the logs of this block of code
> is told dynamically in my application in a new Log4j file
> (log4j.appender.file.File=).
>
> So in other words each time I execute this block of code I create a
new
> Log4J file because I must specify a new directory where to store the
> logs.
> (e.g. first time I execute the specific block of code store log in
> directory 21456, second time in 14598, ...)
>
> So at the start of this code I do :
> PropertyConfigurator.configure(...);
> To load dynamically a new Log4J file (where the new location in which
I
> store the logs is specified)
>
> But when I execute this, the logs aren't stored anymore in the main
log
> file.
> I tried :
> ApplicationLogManager.info("test1");
> PropertyConfigurator.configure(logConfigFileName);
> ApplicationLogManager.info("test2");
> The main log file displays "test1" but nothing anymore below it.
> That is problem #1.
>
> Then when this block of code is exectued, I want to load again the
main
> Log4j file, in the classpath but I don't know how to load this one
> PropertyConfigurator.configure(??);
>
>
> Maybe I'm doing this all wrong :-) (   :(   )
>
> __
>Matt
>
>
>
> -Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 26, 2007 8:55 PM
> To: Log4J Users List
> Subject: Re: Multiple logging files
>
> *  This message comes from the Internet Network *
>
>
> Loggers inherit appenders unless they are told not to.  If you add an
> appender
> to a logger and you want all logging for that logger to go only to the
> appender
> you just add

Re: log4j1.3 alpha8 using joran configurator logs text in folds(multiples)

2007-02-28 Thread Surya Poola
Thanks for your help, I am placing the log4j configuration in classes folder 
,and refer  to the file location using sytem property in xml.
  
Thanks 
  Rohan
James Stauffer <[EMAIL PROTECTED]> wrote:
  If you are calling doConfigure in doGet of each servlet then it is
being configured multiple times -- once for each request processed.
The easiest way to configure it only once is to put the config file in
the classpath and allow it to be automatically configured. An
alternative is to call doconfigure in static code that is only called
once.

On 2/27/07, Surya Poola wrote:
> Iam sure the code is only executed once, why because without specifying any 
> configurator and placing log4j.xml in classes folder of the web application, 
> everything works fine.But when i specify configurator and remove the 
> log4j.xml from classes folder and place log4j.xml in different location and 
> refer the log4j.xml by configurator then iam facing this problem.
>
> Iam running my program through tomcat,and calling my program in doget() 
> method of servlets like:
> logger=Logger.getLogger(this.getClass().getName());
> JoranConfigurator jc = new JoranConfigurator();
> jc.doConfigure("C:\jakarta-tomcat-4.1.30\webapps\log4j.xml",LogManager.getLoggerRepository())
> logger.info("test log" );
>
> Regards
> Rohan
>
> James Stauffer wrote: Are you sure that code is only executed once per 
> program run? Are you
> running in Tomcat, and where are you calling doConfigure?
>
> On 2/27/07, Surya Poola wrote:
> > Iam calling jc.doconfigure only once in my program.I hope this should not 
> > be the
> > problem.
> >
> >
> > James Stauffer wrote:
> > Are you calling jc.doConfigure multiple times? It should only be
> > called once during the program run.
> >
> > On 2/27/07, Surya Poola wrote:
> > > Hi,
> > >
> > > When Iam using joran configurator in log4j1.3 alpha 8 version, log is 
> > > written in folds into log file.ie, first call of execution of my program 
> > > writes the text once, for second call it writes twice and the logging is 
> > > growing exponentially for subsequent calls.
> > >
> > > my code looks like:
> > > JoranConfigurator jc = new JoranConfigurator();
> > > jc.doConfigure("C:\jakarta-tomcat-4.1.30\webapps\log4j.xml",LogManager.getLoggerRepository())
> > > logger.info("test log" );
> > >
> > > I tried using the deprecated DOMConfigurator also, but this also behaves 
> > > the same ,because DOMConfigurator is extended from JoranConfigurator.
> > >
> > > But when i keep the log4j.xml file in classes folder of web application 
> > > and not specifying any configurator then the logging is happening 
> > > perfectly.So i hope the problem is using JoranConfigurator.
> >
> > --
> > James Stauffer http://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]
> >
> >
> >
> >
> > -
> > No need to miss a message. Get email on-the-go
> > with Yahoo! Mail for Mobile. Get started.
>
>
> --
> James Stauffer http://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]
>
>
>
>
> -
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
>
> -
> Access over 1 million songs - Yahoo! Music Unlimited.


-- 
James Stauffer http://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]



 
-
Never Miss an Email
Stay connected with Yahoo! Mail on your mobile. Get started!
  
-
Looking for earth-friendly autos? 
 Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.  

RE: Multiple logging files

2007-02-28 Thread DECAFFMEYER MATHIEU
Yes exactly  :-) Thank u very much,
I realized I did this all wrong.

I have read the Log4J tutorial,

I did the points 1 & 2, but for I have some difficulties on how to
implement point 3 & 4

I switched this to XML :

  
   
   
   
   
   
  
  
  
  
  
  
   
  
  
  
  
   
  
  
  




  


*  In my Java class I don't know how I can specify which appender I
should use,
   Or maybe I can specify the logger in the log4j.xml file ?

*  I don't knwo how to use the system property,
   In the program I suppose I just need to do something like this :
System.setProperty("myProp","updates/"+dirNumber);
   But what do I need to specify in the XML file ?

*  Is it correct what I did in the special appender ? I specified the
file which must include the system property and the same file as the
main appender, 
   is this the good way.


Thank u for any hints!

__
   Matt



-Original Message-
From: James Stauffer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 27, 2007 5:47 PM
To: Log4J Users List
Subject: Re: Multiple logging files

*  This message comes from the Internet Network *

This should do what you want:
1. Switch to XML config.
2. Define your main appender and special appender
3. Use a system property for the name of the file in the special
appender.
4. Make sure you have your loggers setup so logs from the special part
of your code go to the special appender.

On 2/27/07, DECAFFMEYER MATHIEU <[EMAIL PROTECTED]> wrote:
> Thanks for your response,
> it's not exactly what I want actually :
>
> I have a main log where every log is stored,
> But in a part of my code I want to log in a separate file (and still
in
> the main log file),
> the location in which I must store the logs of this block of code
> is told dynamically in my application in a new Log4j file
> (log4j.appender.file.File=).
>
> So in other words each time I execute this block of code I create a
new
> Log4J file because I must specify a new directory where to store the
> logs.
> (e.g. first time I execute the specific block of code store log in
> directory 21456, second time in 14598, ...)
>
> So at the start of this code I do :
> PropertyConfigurator.configure(...);
> To load dynamically a new Log4J file (where the new location in which
I
> store the logs is specified)
>
> But when I execute this, the logs aren't stored anymore in the main
log
> file.
> I tried :
> ApplicationLogManager.info("test1");
> PropertyConfigurator.configure(logConfigFileName);
> ApplicationLogManager.info("test2");
> The main log file displays "test1" but nothing anymore below it.
> That is problem #1.
>
> Then when this block of code is exectued, I want to load again the
main
> Log4j file, in the classpath but I don't know how to load this one
> PropertyConfigurator.configure(??);
>
>
> Maybe I'm doing this all wrong :-) (   :(   )
>
> __
>Matt
>
>
>
> -Original Message-
> From: Jacob Kjome [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 26, 2007 8:55 PM
> To: Log4J Users List
> Subject: Re: Multiple logging files
>
> *  This message comes from the Internet Network *
>
>
> Loggers inherit appenders unless they are told not to.  If you add an
> appender
> to a logger and you want all logging for that logger to go only to the
> appender
> you just added to it, you'll have to set additivity="false" to this
> logger.
>
> log4j.additivity.com.mycompany.MyClass=false
> OR
> 
> 
> 
>
>
> Jake
>
> Quoting DECAFFMEYER MATHIEU <[EMAIL PROTECTED]>:
>
> >
> > Hi,
> >
> > I have a main log file where all the logs are stored of the
> application.
> > But I have a block of instructions in my application and I want the
> logs
> > of this code to be stored in another log file.
> >
> > So I execute this :
> >
> > PropertyConfigurator.configure(...);
> >
> > It works ok, but the logs are now stored in both file :
> > the file I specified in the configure method above
> > the main log file
> >
> > Can anyone help ?
> >
> > Thank u.
> > __
> >
> >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 le