Add messages to Event Log?

Thought this would be a simple search but- I can’t find it.

How can I add arbitrary messages to the System Event Log? (not the Linux one, the one that persists and appears in the RutOS GUI)

Is this possible?

Greetings,

What kind of messages are you referring to exactly? You might
be able to edit the messages that you see within the System Log by compiling a custom SDK of the firmware, but by default this is not something that is configurable. More information on custom SDKs can be found here: RUTOS Software Development Kit (SDK) Instruction - Teltonika Networks Wiki

Regards,
M.

ubus call log write_ext '{"event": "event message", "sender": "event source name", "table": 0, "write_db": 1}'

“table” can be 0 (events); 1 (connections); 2 (system); 3 (network)

1 Like

@JoeA That’s what I was looking for! Thank you. Out of curiosity, where did you find this info?

Just adding a minor correction. In my testing, I found that the IDs in RutOS correspond to the following table/priority values:

ID Table (“Event group”) Priority (“Event type”)
0 Events Emerg
1 System Alert
2 Network Crit
3 Connections Err
4 - Warn
5 - Notice
6 - Info
7 - Debug

E.g. to write a “Critical” error message to the “System” log area:

ubus call log write_ext '{"event": "This is a very important message", "sender": "My Script", "table": 1, "priority": 2, "write_db": 1}'

1 Like

I’ve found it while looking into /sbin/reboot file as the message can be seen when you normally reboot the device. I don’t think its documented somewhere and I haven’t seen this in API docs either.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.