Debug.log in Java service


I found in GEAR 6.5 Developer’s Handbook that for writing custom log is useful Debug.log(logLevel,logMessage) but I also found out that this method is already deprecated.

So is there any replacement for this method? I don’t like to use deprecated methods.

Thx for answers

You can use built-in-service pub.flow:debugLog , which is certainly not depreciated even in 7.X versions… or alternatively write your Java code using the apache log4j methods.


As the name says: pub.flow:debugLog should be only for debugging and I would highly discourage leaving this in any code going to a productive environment.
Try writing a Java service using log4J (already inluded in IS classpath) and write to specific files (or wherever else you want to log as log4j is quite flexible), so IS log is kept for IS system messages only and you can use the same logging in flow as well as in java services.
A short concept how to log should also applied.

The custom application log facilities within IS as described at may be a fit in this scenario.

I agree that using debugLog for your own messages is problematic–mostly in that it can be difficult to wade through all the noise to find what you’re looking for.

I too agree on the above two experts advice that using debug log to write for custom messages should be avoided.
I would say first of all decide upon where you want to write this custom log… if FF than you can write java code (check the link which reamon suggested) if DB which is even preferred by SAG because of obvious reasons… then you can think abt the JDBCadapters/again custom java code etc…