Copy Logging Handler Source Code

Hi Friends,

can anybody have an idea about Copy Logging Handler Source code in Logging SubSystem. if anybody have an idea plz try to give some idea about the following requirement.

Following steps will be performed by the handler:

  1. Use the mutex to lock the file.

  2. Create a buffer of 1MB size and copy the log messages in the log file to the buffer. Each log file is of MAX 1 MB size and this enables copying of one file as a whole at a single point in time.

  3. Release the mutex to unlock the file.

  4. Fetch the log messages from the RAM one by one and filter the messages according to the options provided by the user. The filtered log message is moved to another buffer, which contains only the filtered messages that has to be sent back to the TL1 interface(take some example interface).

Why couldn’t you just open /dev/slog directly, issue reads() to retrieve log messages, filter them, and output them however you want?
I think there’s an example on how to do this in the documentation for slogger.