logging - Is it ok to log the source class name and method name in a java product? -


I am currently working on Java applications for some network monitoring tools. In my code I should use logging. Since this is a network management software, the information in the log is very useful for the user, so it is mandatory to use it. But now I'm a bit confused which type of logger method I should like now I am using Logger.lop (... // ...) , so with our help we The name and method of the class are also logged, so it is very easy for me (developers) to get the code and error to debug, but in the end I am confused that I distribute the same user with the same logging mechanism Do not Does it tell your user what type of class is currently executing, in which method has an error? I have seen many products several times in the stacktrace handling exceptions, so in general we also get class names. So there is no problem in doing this, that the gap will come to know that what is your class name and method?

Consider the impact of security on this, dynamically, actual classname by logging feature and To get the method name, most logging systems require reflection and slow down logging dramatically - usually a synchronous operation, my guess is that in a network monitoring application, you really do not want to do this Are there.

If you are hard-coding method name in the log message (either by creating part of the message or by category), this is a different story as a security person, I do not consider it a big deal - If your code is in Java, then it can be reversed in some way, so your code should work in such a way that it is safe even if the code was given.

It is being said that all, you can use a different logging configuration for development and production, or you can go to debug, trace, and heard those heard. If you are using log4j, it is generally recommended to use isDebugEnabled to include any logging statement that is calculated before the logging statement, which is active Yes or No.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

c# - Confused over DLL entry points (entry point not found exception) -