Skip to content

Get existing logger

Jörg Neumann edited this page Jan 14, 2022 · 3 revisions

The factory implements a singleton pattern (see: Central Concepts -> One Log) and will continue to return the very same logger, until the owner of that logger is done with it and explicitly destroys it. This allows us to get an already existing logger anywhere down the call chain without having to pass it from method to method.

DATA(logger) = /usi/cl_bal_factory=>get_instance( )->get_existing_logger( ).

Regular behavior

The method returns the already bound singleton.

Error handling

If - for some reason - the logger has not yet been initialized, the method will internally create a new logger and bind the singleton. It will use the default log object (see: Troubleshooting -> Log cannot be found) to do so.

Clone this wiki locally