Trouble with Log4J

F

FET

Hi everyone,

I have a large Java application that is composed of lots of different
packages. I am using a log server for central logging. There is a Log
Server at some remote location that uses the Log4J API to log messages
received from various components.

For communicating with this log server, there is a Log Client that I
have coded. The log client uses simple sockets to communicate since a
handshake is required before the log Server actually starts logging.

This Log Client works well except for one thing. I want Debug logs as
well. For this, I implement a Log4J Logger within the Log Client, that
writes to one file. The logger is assigned a PatternLayout with the
formatter that prints the Class name, method name and line number.
This Log Client class also contains a debugPrint(Object) method that
actually calls the Log4J log methods.

The problem is that the Class information, method and line number
information is always of Log Client class and NOT of the class that
has called the debugPrint() method.

How do I overcome this problem ?

Thanks in advance.

Best Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top