Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2019 10:35:03 -0400
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        Slawa Olhovchenkov <slw@zxy.spb.ru>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: haproxy syslog comptible
Message-ID:  <30C12D55-56E1-43BC-90FE-D870BF811718@gromit.dlib.vt.edu>
In-Reply-To: <20190624141721.GK47119@zxy.spb.ru>
References:  <20190624141721.GK47119@zxy.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 24, 2019, at 10:17 AM, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:

> I am use haproxy logged to syslog and have log lines like this:
>
> Jun 24 17:04:25 ha01 haproxy[32508]: 193.34.87.146:57625  
> [24/Jun/2019:17:04:23.277] balancer~ default-pool/main 0/0/0/-1/2012 504  
> 194 - - sH-- 888/888/4/4/0 0/0 "POST /vs HTTP/1.1"
>
> Is this posible to learn syslogd to use mileseconds timestamps?
> _______________________________________________
> freebsd-stable@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


Run syslogd with "-O syslog" to get timestamps logged with microsecond  
precision (as well as time zones).  You can add that to your  
"syslogd_flags" setting in /etc/rc.conf.  (See man syslogd for details.)

Note that the format of syslog entries changes with "-O syslog".  You get  
logs like this:

<38>1 2019-04-12T10:43:56.525458-04:00 xxxxx.xxxxx.net sshd 1253 - -  
Received signal 15; terminating.
<38>1 2019-04-12T10:48:05.058693-04:00 xxxxx.xxxxx.net sshd 1238 - - Server  
listening on :: port 22.


(Note that the precision also depends upon the client application logging  
to syslog.)

Cheers,

Paul.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?30C12D55-56E1-43BC-90FE-D870BF811718>