log4j

Deserialize in a different language.

The log4j network adapter sends events as a serialised java object. I would like to be able to capture this object and deserialise it in a different language (python). Is this possible? NOTE The network capturing is easy; its just a TCP socket and reading in a stream. The difficulty is the deserialising part ...

Customising log4j adapter

I want to build my own custom log4j (network) adapter to solve my problem that I posted here. I have looked at the documentation on the log4j and I cant see where/if the developers go into how to do this. Can anyone point me in the right direction to get started? ...

Should a Log4J logger be declared as transient?

I am using Java 1.4 with Log4J. Some of my code involves serializing and deserializing value objects (POJOs). Each of my POJOs declares a logger with private final Logger log = Logger.getLogger(getClass()); The serializer complains of org.apache.log4j.Logger not being Serializable. Should I use private final transient Logger log...

Logging activities in multithreaded applications

I have a layered application in Java which has a multi thread data access layer which is invoked from different points. A single call to this layer is likely to spawn several threads to parallelize requests to the DB. What I'm looking for is a logging tool that would allow me to define "activities" that are composed by various threads....

Best way to aggregate multiple log files from several servers

I need a simple way to monitor multiple text log files distributed over a number of HP-UX servers. They are a mix of text and XML log files from several distributed legacy systems. Currently we just ssh to the servers and use tail -f and grep, but that doesn't scale when you have many logs to keep track of. Since the logs are in differe...

log4j log file names?

We have several jobs that run concurrently that have to use the same config info for log4j. They are all dumping the logs into one file using the same appender. Is there a way to have each job dynamically name its log file so they stay seperate? Thanks Tom ...

Log4j: Why is the root logger collecting all log types regardless the configuration?

I am having problem that even though I specify the level to ERROR in the root tag, the specified appender logs all levels (debug, info, warn) to the file regardless the settings. I am not a log4j expert so any help is appreciated. Here is a bit more info on the subject: I have checked the classpath for log4j.properties (there is none)...

How to configure Tomcat JULI logging to roll log files?

I have a several webapps which use java.util.logging. Tomcat 5.5 is configured to use the Juli logger so that each webapp has its own log file. The problem is that Juli does not have properties for maximum file size and file count. Using Juli the files will grow unbounded and only roll at the end of the day. Also, an unlimited number...

Splitting log4j Output with Quartz Worker Threads

I'm working on an application that consists of an overall Quartz-based scheduler and "CycledJob" run using CronTriggers. The purpose of the application is to process inputs from different email inboxes based on the source country. Based on the country that it comes in from (i.e. US, UK, FR, etc.) the application triggers one job thread...

Java Log Viewer

Hi all, Unfortunately, sometimes the only way to debug a program is by going through its long log files. I searched for a decent log viewer for a while now, and haven't found a real solution. The only program that seemed to be most appropriate was Chainsaw with its Socket connector but after a few short uses the program proved to be b...

Subcribe via RSS for log4j logs?

Is it possible to subscribe to a url with log4j logs? I understand that many applications do have daily error logs notification by email. But a problem with this approach is that the server that host the application may not provide smtp capability. Thus the RSS subscribe approach seens to be more flexibile. Anyone know how is this being...

Logging conventions

What conventions do you use for log categories in log4j or similar libraries ? Usually you see class names as categories, but have you used other systems ? What about log levels ? What levels do you use and in which case ? Update: as some of you replied, there is no 'right' answer. I'm just looking for what different conventions people...

Why log4j cannot generate backup files?

I'm running some java processes on Windows 2003 server R2 I'm using Apache log4j-1.2.8. All my processes called via one jar file with different parameter example java -jar process.jar one java -jar process.jar two java -jar process.jar three And I config log4j.properties follow #=============================== # Decla...

log4j vs logback

We are using log4j behind a selfmade wrapper. We plan to use much more features of it now. Should we update to logback ? (I mean the framework not a facade like SLF4J) ...

Should new projects use logback instead of log4j ?

Should new projects use logback instead of log4j as a logging framework ? Or with other words :'Is logback better than log4j (leaving the SLF4J-'feature' of logback beside)?' ...

Setting a log file name to include current date in Log4j

I would like to set the log file name for a log4j and log4net appender to have the current date. We are doing Daily rollovers but the current log file does not have a date. The log file name format would be logname.2008-10-10.log Anyone know the best way for me to do this? edit: I forgot to mention that we would want to do this i...

Using system environment variables in log4j xml configuration

Is it possible to reference system environment variables (as opposed to Java system properties) in a log4j xml configuration file? I'd like to be able to do something like: <level value="${env.LOG_LEVEL}" /> and have it get that from the system environment variables, so I can avoid having to pass in so many things with -D parameters....

Log4j usage - how to customize the event ID when logging to Windows Event Log?

I'm adding windows event logging functionality to an existing Java application and I'd like to utilize event ids(our admin is using them already). Is there a way to specify the event ID when logging with NTEventLogAppender? ...

Log4j, configuring a Web App to use a relative path.

I have a java webapp that has to be deployed on either Win or Linux machines. I now want to add log4j for logging and I'd like to use a relative path for the log file as I don't want to change the file path on every deployment. The container will most likely be Tomcat but not necessarily. What's the best way of doing this? ...

Problem with Commons Logging / Log4j setup in spring webapp with tomcat 6

I have a problem wih a logging setup in a apring webapp deployed under tomcat 6. The webapp uses the commons-logging api, on runtime log4j should be used. The log file is created but remains empty - no log entries occur. the setup is the following: WEB-INF/web.xml: <context-param> <param-name>log4jConfigLocation</param-name> ...