Log4J Customization


Myself trying to implement log4j frame work in my project.The actual requirement is to

reate the services so that other developers can use the log4J framework to log project

specific stuff into their own project log files.

To do so, the service should provide as input:

  • Project (which log file to use)
  • Severity (Error / Fatal / info / debug …)
  • Message (The actual error message …)
  • ID (A concept of a unique ID, to identify a certain errormessage based on the ID)

And then three services to be created using the above- startServiceLogging (To be implemented at the beginning of each service to log service related data)

  • endServiceLogging (To be implemented as a last step within each service to log successful ending)
  • errorServiceLogging (To be implemented as a error catch step within each service to log failures)

Need favour to implement the above scenarios.The approach to implement the scenario.Have any one done this type of implementation in the projects? If so plz do send some sample packages.

Review the logging.zip file in the Shareware area for one approach.



I am using something similar to this logging package. It works fine (for a while) after I initialize using PropertyConfigurator… a day or two later, it stops logging to the rolling log file.
I have to manually invoke the service (that calls configure) to start logging,

if (logger.isEnabledFor§) {


it goes in to the above if block, which means logger is not null or anything, but when logger.log(…) is called in that block, nothing happens. I have this wrapped in try/catch and calling pub.flow.debugLog in catch, nothing in the server log either…

I just changed to DailyRollingFileAppender… I am hoping that might make any difference…


Is there a equivalent shareware package available for log4net ?

Not until you write one. Never heard of log4net. There are zillions of log4xxx projects. What does log4net do?


Ok. Thanks.

log4net (Log4Net) is one part of the Logging Services Project at Apache : http://logging.apache.org/.

How would log4net’s .Net logging support be useful in a Java-based integration server? I must be missing something.


I am in the process of understanding how all the pieces could fit together.

The Integration server (Java based WebMethods) runs on Microsoft platform. The corporate preference is to use Microsoft technology for any custom code
.Net is the prefered path. log4net is being used for many projects

My understanding is that WebMethod Flow services could invoke calls to external modules written in C#/.Net.
So if we have to write Application Logging services framework they could invoke calls to log4net. Is my understanding correct ?
This is where the log4net equivalent of the shareware package for WebMethods could help.
Is there a architecture diagram for your shareware package by any chance.


Since the Apache Logging Services Project claims a “basic level of interoperability” between the various logging projects listed on their web page, it would seem that you could produce output identical to that produced by Log4Net, without adding an architectural layer for something that is supposed to be unobtrusive like logging.

Making calls to methods residing in .Net assemblies (a potentially non-trivial exercise) simply to avoid calling an equivalent method in java seems counter-intuitive.


I understand the shareware package (log4j for WebMethods) logs to files.
Does the framework have the extensibility to add features to add to log to backend RDBMS.

We are investigating optimum ways for Application monitoring. If we could log messages into relational tables (for easier queries and creating web GUI front ends for searching/sorting/filtering) compared to a file that would be nice.

The other choice would be write to Log files first and then load into tables.

Any suggestions, comments ?


I havent had a look at the package provided (log4j for webMethods), but it is possible to write an log4j appender to write to Db;

Though, I may suggest, looking at other options apart from log4j; :smiley: For ex. why cant you write a generic logmessage svc to be invoked whenever you want anything logged… that logmessage svc will use an existing jdbc adapter connection and insert the “log message” in the table given… you can make use to pub/sub features also to log to a common db source from multiple instances… we use something similar setup (without log4j - all custom code);

The only limitation is imagination!! :p:


Saurabh is correct. Log4J appenders are the way to go as the other Log4xxx projects should be able to use similar appenders functionality.

There are several Log4J addin projects such as Chainsaw and Log Factor 5 that provide GUI consoles. However, they would be mostly java-based. Not sure whether there are non-java logging consoles that could read log messages written to a dbms, but I would assume so.


I know it has been a while since this post. I am new to web methods and I am thinking of implementing LOG4j for custom logging. I have downloaded the code you wrote. Can you tell me how to start using it? i don’t know how to even install that code to be able to use it.