vvekselva
vvekselva

Reputation: 823

Implement logging in a compiled Java application?

I've a standalone compiled java application. I don't have source files for this application and I am facing an issue. I need to fix this issue and need to log some information. I have only .class files at my disposal. Is it possible to modify these files to enable logging of some information?

Upvotes: 1

Views: 228

Answers (3)

Yogesh_D
Yogesh_D

Reputation: 18809

I believe you can use aspectj for this.. a quick google search gave me this link.. http://java.jiderhamn.se/2013/08/23/debugging-third-party-libraries-with-aspectj-and-maven/

see if this helps..

Upvotes: 1

Sujith PS
Sujith PS

Reputation: 4864

You can De-compile your class files , and can get the codes corresponding to your class files.

Then you can create new files with same name , with change in logging code .

Refer this for more details about De-compiler.

Upvotes: 1

sachin garg
sachin garg

Reputation: 1316

No, you won't. The only option left to you is, de-compile the class files and get the code.

Upvotes: 0

Related Questions