trace-agent icon indicating copy to clipboard operation
trace-agent copied to clipboard

Log4j logging

Open bimalc opened this issue 4 years ago • 2 comments

For my debugging purpose It is helpful to have the Agent output along with the role log messages from the component instead of isolated in stdout. That way the messages comes in exact order along with other log messages. I have added code to use log4 and have kept it as a global configurable as well as ability to configure it specific to any action.

Please reviews this and see if it is worth merging.

bimalc avatar Mar 16 '21 01:03 bimalc

Thanks for this contribution!

Some questions first:

  • have you tested this on an application which uses very different log4j version?
  • how the classpath of the agent and the classpath of the tested app relates? (I know nothing about this and this is why I used std JDK method for logging).

attilapiros avatar Mar 17 '21 16:03 attilapiros

Hi Attila,

I tested with different versions but never got any issue. But maybe because the versions were still compatible. I will try to test to see if this will put limitation on agent that it will work only with Applications using a certain version of log4j. ( But even if there is such limits, since we know what our components are using and if it works for it then we can just state the limitation in our README and can use with our components.)

As far as classpath is concerned, I would assume both has the same classpath. If the application does not have log4j already in there classpath then we might ahve to add it for the agent to work. Again< I will test it with app not having log4j in there classpath and provide the steps needed in such cases.

I will look into both the issues and get back to you.

Thanks & Regard Bimal

Regards Bimal

On Wed, Mar 17, 2021 at 11:16 AM Attila Zsolt Piros < @.***> wrote:

Thanks for this contribution!

Some questions first:

  • have you tested this on an application which uses very different log4j version?
  • how the classpath of the agent and the classpath of the tested app relates? (I know nothing about this and this is why I used std JDK method for logging).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/attilapiros/trace-agent/pull/11#issuecomment-801217100, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEW6UREOMX5PC72WT75W27TTEDIW7ANCNFSM4ZHSTVAQ .

bimalc avatar Mar 17 '21 17:03 bimalc