Re: multiple JVMs writing to the same file
You could also run a central syslog-ng server, and have the various JVMs send to it via a SyslogAppender . syslog-ng is free and powerful, you can do regex filtering and dump to file however you like. It supports the more reliable TCP, however last time I checked log4j only supports UDP, so failover may be an issue here too. - Original Message From: "Zakaria, Faheem" <[EMAIL PROTECTED]> To: Log4J Users List Sent: Tuesday, July 31, 2007 6:11:39 AM Subject: RE: multiple JVMs writing to the same file Hi Thomas, There are two choices to your situation. 1. Save log output locally for each JVM and use a distributed log reader for log analysis. This has the benefits of centralized logging without the mandate. Of course, maintenance processes of identifying, indexing and collating logs across JVMs can outweigh the benefits of this approach. Splunk and Veduta are two products which can help in this category. 2. Centralize your logging using the JMSAppender and a messaging platform. Each JVM would queue its log messages to a central logging server. The logging server would receive log messages and persist them to file or DBMS. There are failover issues associated with this approach and would need to be balanced within the context of your architecture. The messaging middleware can mitigate log server failover. -Faheem -Original Message- From: Thomas michelbach [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 31, 2007 8:30 AM To: Log4J Users List Subject: Re: multiple JVMs writing to the same file Thanks for the answer, The socket appender is a good option, but i read this article http://www.jroller.com/oburn/date/200601 and was concerned about possible problems (deadlocks). the first problem would arise if thd JVM receiving the logs goes down or even goes into a deadlock. I need a way to bring the socket appender up in another JVM as failover mechanism. Another problem is if the file gets locked, I can't do anything until the JVM is restarted and this is definitely not a good failover. Does someone have experience with this kind of multiple jvm logging architectures? Bye, Thomas On 7/31/07, James Stauffer <[EMAIL PROTECTED]> wrote: > > You can have each JVM send the events to a single separate JVM with > SocketAppenders. That single separate JVM would receive events from > all of the other JVMs and write them to a file. > > On 7/31/07, Thomas michelbach <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm using log4j in an environment with multiple jvms. I know that the > best > > option for a central logging output, would be a database, but in this > > environment I don't have one. Now I use a different file for each jvm, > but I > > need to consolidate them in one file. > > > > The best case would be to have the same appender in each JVM and they > would > > have a buffer to protect the file and control the I/O. Is there any > sample > > how to do this in log4j? Is it supported? > > > > Bye, > > Thomas > > > > > -- > 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] > > -- Thomas Michelbach - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
Re: level based logging into seperate files
Here are appenders for DEBUG, INFO, WARN, and ERROR: On 7/31/07, Sarvananda <[EMAIL PROTECTED]> wrote: > > > > James Stauffer wrote: > > > > I have created one appender per level but each appender gets logs of > > the given level and above. Do you want to see an example of that? > > > > Yes pleae. Id be grateful for that. > > thanks > > -- > View this message in context: > http://www.nabble.com/level-based-logging-into-seperate-files-tf4150902.html#a11929271 > Sent from the Log4j - Users mailing list archive at Nabble.com. > > > - > 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: level based logging into seperate files
James Stauffer wrote: > > I have created one appender per level but each appender gets logs of > the given level and above. Do you want to see an example of that? > Yes pleae. Id be grateful for that. thanks -- View this message in context: http://www.nabble.com/level-based-logging-into-seperate-files-tf4150902.html#a11929271 Sent from the Log4j - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple JVMs writing to the same file
Hi Thomas, There are two choices to your situation. 1. Save log output locally for each JVM and use a distributed log reader for log analysis. This has the benefits of centralized logging without the mandate. Of course, maintenance processes of identifying, indexing and collating logs across JVMs can outweigh the benefits of this approach. Splunk and Veduta are two products which can help in this category. 2. Centralize your logging using the JMSAppender and a messaging platform. Each JVM would queue its log messages to a central logging server. The logging server would receive log messages and persist them to file or DBMS. There are failover issues associated with this approach and would need to be balanced within the context of your architecture. The messaging middleware can mitigate log server failover. -Faheem -Original Message- From: Thomas michelbach [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 31, 2007 8:30 AM To: Log4J Users List Subject: Re: multiple JVMs writing to the same file Thanks for the answer, The socket appender is a good option, but i read this article http://www.jroller.com/oburn/date/200601 and was concerned about possible problems (deadlocks). the first problem would arise if thd JVM receiving the logs goes down or even goes into a deadlock. I need a way to bring the socket appender up in another JVM as failover mechanism. Another problem is if the file gets locked, I can't do anything until the JVM is restarted and this is definitely not a good failover. Does someone have experience with this kind of multiple jvm logging architectures? Bye, Thomas On 7/31/07, James Stauffer <[EMAIL PROTECTED]> wrote: > > You can have each JVM send the events to a single separate JVM with > SocketAppenders. That single separate JVM would receive events from > all of the other JVMs and write them to a file. > > On 7/31/07, Thomas michelbach <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm using log4j in an environment with multiple jvms. I know that the > best > > option for a central logging output, would be a database, but in this > > environment I don't have one. Now I use a different file for each jvm, > but I > > need to consolidate them in one file. > > > > The best case would be to have the same appender in each JVM and they > would > > have a buffer to protect the file and control the I/O. Is there any > sample > > how to do this in log4j? Is it supported? > > > > Bye, > > Thomas > > > > > -- > 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] > > -- Thomas Michelbach - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple JVMs writing to the same file
Thanks for the answer, The socket appender is a good option, but i read this article http://www.jroller.com/oburn/date/200601 and was concerned about possible problems (deadlocks). the first problem would arise if thd JVM receiving the logs goes down or even goes into a deadlock. I need a way to bring the socket appender up in another JVM as failover mechanism. Another problem is if the file gets locked, I can't do anything until the JVM is restarted and this is definitely not a good failover. Does someone have experience with this kind of multiple jvm logging architectures? Bye, Thomas On 7/31/07, James Stauffer <[EMAIL PROTECTED]> wrote: > > You can have each JVM send the events to a single separate JVM with > SocketAppenders. That single separate JVM would receive events from > all of the other JVMs and write them to a file. > > On 7/31/07, Thomas michelbach <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I'm using log4j in an environment with multiple jvms. I know that the > best > > option for a central logging output, would be a database, but in this > > environment I don't have one. Now I use a different file for each jvm, > but I > > need to consolidate them in one file. > > > > The best case would be to have the same appender in each JVM and they > would > > have a buffer to protect the file and control the I/O. Is there any > sample > > how to do this in log4j? Is it supported? > > > > Bye, > > Thomas > > > > > -- > 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] > > -- Thomas Michelbach
Re: level based logging into seperate files
I have created one appender per level but each appender gets logs of the given level and above. Do you want to see an example of that? On 7/31/07, Sarvananda <[EMAIL PROTECTED]> wrote: > > Thank you so much for your reply James. > > > James Stauffer wrote: > > > > Are you using an un-modified log4j.jar? Open your log4j.jar and verify > > that org.apache.log4j.PatternLayout exists in it. > > > > Yes it does. I am using version 1.2.14. > Logging as such works fine (makes me believe that the PatternLayout is > workin from the properties file) > if I use a simple properties file and append all levels into one single > file. Of course,thats not what I want. Since filters are the only way I can > append into different files, and filters are possible only with an xml file. > I am using the above, and having problems > Have you or has anyone tried to do this (seperate levels of logs into > seperate log files)? If yes please let me know the approach/code for this. > > -- > View this message in context: > http://www.nabble.com/level-based-logging-into-seperate-files-tf4150902.html#a11918863 > Sent from the Log4j - Users mailing list archive at Nabble.com. > > > - > 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 JVMs writing to the same file
You can have each JVM send the events to a single separate JVM with SocketAppenders. That single separate JVM would receive events from all of the other JVMs and write them to a file. On 7/31/07, Thomas michelbach <[EMAIL PROTECTED]> wrote: > Hello, > > I'm using log4j in an environment with multiple jvms. I know that the best > option for a central logging output, would be a database, but in this > environment I don't have one. Now I use a different file for each jvm, but I > need to consolidate them in one file. > > The best case would be to have the same appender in each JVM and they would > have a buffer to protect the file and control the I/O. Is there any sample > how to do this in log4j? Is it supported? > > Bye, > Thomas > -- 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]
multiple JVMs writing to the same file
Hello, I'm using log4j in an environment with multiple jvms. I know that the best option for a central logging output, would be a database, but in this environment I don't have one. Now I use a different file for each jvm, but I need to consolidate them in one file. The best case would be to have the same appender in each JVM and they would have a buffer to protect the file and control the I/O. Is there any sample how to do this in log4j? Is it supported? Bye, Thomas