Klibs: syslog: use IMAGE_NAME environment variable as APP-NAME
With this change, if the IMAGE_NAME environment variable is present
it is used to populate the APP_NAME field in syslog messages, while
the program name is used as a fallback.
@@ -439,6 +439,9 @@ int init(status_handler complete)
}
if (syslog.server) {
syslog_server_resolve();
+ tuple env = get_environment();
+ syslog.program = get(env, sym(IMAGE_NAME));
+ if (!syslog.program)
syslog.program = get(root, sym(program));
syslog.max_hdr_len = 1 + sizeof(__XSTRING(SYSLOG_PRIORITY)) + sizeof(SYSLOG_VERSION) +
sizeof("YYYY-MM-ddThh:mm:ss.uuuuuuZ") + sizeof(syslog.local_ip) +
