On Wed, Oct 5, 2016 at 6:41 PM, Kevin Houlberg <[email protected]> wrote:
> Hello,
>
>
>
> Is it possible to change the date and time format of the syslog messages
> when using syslogd?
>
>
>
> Current format: Jan 01 02:04:40 user.info
> fpgaIOService[1391]: Ethernet port 1 is down
>
>
>
> Desired format: 2016-02-29T16:29:04.045Z user.info
> fpgaIOService[1391]: Ethernet port 1 is down
Unfortunately, timestamps in logs are produced by clients:
#include <syslog.h>
int main() {
syslog(LOG_INFO, "Hello");
return 0;
}
$ strace ./testprog
...
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/dev/log"}, 110) = 0
sendto(3, "<14>Oct 7 16:13:31 testprog: Hello", 35, MSG_NOSIGNAL, NULL, 0) = 35
^^^^^^^^^^^^^^^
What do you propose for syslog to do with underlined part of the message?
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox