Skip to content
Advertisement

How to remove/modify syslogd message’s header?

I’m currently use the syslogd of busybox for logging some information. However, I’m unable to modify the message’s header. I log the message like this:

JavaScript

And I got this output:

JavaScript

I want to replace message’s header with epoch time format like this:

JavaScript

Or is there any way to completely remove the message’s header so I could manually add the epoch time in code?

Advertisement

Answer

I have done the research around and found that it is impossible to modify the output message log of syslogd with supported configuration. So I dig into the busybox’s source code and modify it. If you face the same issue, you could find it at function:

JavaScript

I check the pri variable to see which level log is it and change the actual outcome message, which is msg.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement