ABAP logging made easy using simple logger utility class ZCL_LOGGER

In the last post, Application logging in ABAP. I talked about application logging.

It's an excellent utility but it's cumbersome from a developer's point of you. Especially if you work or have worked with languages like JavaScript where logging is as easy as Console.log("your text").

to add the same level of ease, I created a utility class that makes logging easy.

Starting a log is as easy as instantiating the object. Below is the example :

Adding messages to the log becomes a single line code:

Here is the snippet to save the log.

Notice how you don't have to worry about saving the log messages.. because the class saves your messages the moment you add them, so you don't have to worry about collecting your logs and making sure the save happens in all scenarios.

Now I will take the same code snippet that I shared in the last post and rewrite it using the logger class to show how convenient it is to use the utility.

Here is the link to the source: simple ABAP logger

Use the utility as it is or modify it to suit your needs. As always, hope you like the post and utility and use it in your day to day work.

Popular posts from this blog

ABAP convert internal table to excel (.xlsx) format and Send email or download

ABAP read excel(.XLSX) file to internal table in ABAP using CL_FDT_XL_SPREADSHEET

Application Logging in ABAP