Managing OE Logger framework's output

Posted by Akshay Guleria on 30-Jan-2020 08:21

I'm replacing LOG-MANAGER logger with OE Logger in an application. The main reason for doing this is
1. Cleaner and focused logs since we will log only what we need.
2. Providing access to logs via a standard .

Ideally, we want to have separate log file for each process since that's how it has been while we were using LOG-MANAGER logger. And we really do not want to define a default logger as everything gets mixed up into one log.

Issues I face
1. Redirecting all logs to configured log file (in logging.config). Classes which build the Logger object with known name are ok since they know to which file to log to but the classes which comes with OE installation create the Logger object with their own class reference `this-object:Logger = LoggerBuilder:GetLogger(this-object:GetClass())`. So these logs will either go to default logger (if defined) or it will go to gutter/sink, basically not logged.

Is it possible at all to capture all the logs into
- 1 defined log file
- with OE Logger framework
- no matter how the Logger object is created?
I have my doubt for technical reasons but since I don't know the framework in and out, I'm still hopeful. :)

2. Is it possible to log the creation and deletion of dynamic objects with OE Logger? Like it is done with LOG-MANAGER:LOG-ENTRY-TYPES.

All Replies

Posted by Peter Judge on 30-Jan-2020 15:12

The OE logger names follow the "named hierarchy" pattern of Log4j (http://logging.apache.org/log4j/2.x/manual/architecture.html) . So if you want all logging for the components OE provides, set up a logger named "OpenEdge" and you'll get all those messages. You can then decide where to send those logs (including the sink/gutter if you choose). Our convention is to ask for logs named for the type (eg "OpenEdge.Web.WebHandler") and since the OOABL classes we ship are all in the OpenEdge namespace, that will work.
 
So the answer to Q1 is "yes".
 
The answer to Q2 is sadly "no". The AVM/ABL does not give the ability to redirect those messages anywhere but the LOG-MANAGER:LOGFILE-NAME.
 
 
 
 
 

Posted by Akshay Guleria on 31-Jan-2020 14:02

Thanks for your answer [mention:9e4ee96fac634b8f91b580e1fb4f7e71:e9ed411860ed4f2ba0265705b8793d05].

Q1. It is something I wanted to avoid, i.e. to send logs of 1 process to different log files. Might appear okay-ish via some while using some Logging GUI tool (like kibana) but if you have to check the physical log file on the server then it's not so convenient.

This thread is closed