server icon indicating copy to clipboard operation
server copied to clipboard

Include year in triton server logs

Open iliakur opened this issue 2 years ago • 7 comments

When we inspect triton server logs we see entries like this:

 I1011 13:21:57.174321 1 cache_manager.cc:174] Creating TritonCache with name: 'local', libpath: '/opt/tritonserver/caches/local/libtritoncache_local.so', cache_config: '{"size":"1048576"}'

All of this is undocumented, so our guesses are:

  • I is the log level
  • 1011 is October 11th, the date
  • then there's the time and the logger and the message.

There's no year, however. Our parser can infer the year usually correctly, but to avoid any ambiguities in the future, it would be useful to have the year in the log message itself.

iliakur avatar Nov 20 '23 09:11 iliakur

Hi @iliakur, you can set the log format to ISO8601 when launching the server. https://github.com/triton-inference-server/server/blob/main/src/command_line_parser.cc#L598

kthui avatar Nov 20 '23 21:11 kthui

@kthui thanks for the quick response, duly noted! any reason why the default format doesn't include a year?

iliakur avatar Nov 21 '23 08:11 iliakur

any reason why the default format doesn't include a year?

Maybe @GuanLuo or @nnshah1 might know more about this.

kthui avatar Nov 21 '23 20:11 kthui

@iliakur - Unfortunately I don't know if there was a specific reason chosen for the default format of the timestamp portion of log entries. We've kept it that way for backwards compatibility and added the ISO8601 format.

Does the IS08601 format work for you?

nnshah1 avatar Nov 21 '23 21:11 nnshah1

Thanks! I'm developing a log-processing pipeline for our (Datadog's) integration with Triton server. So both formats "work for" me, I can get them to work. I just found it surprising that the log messages can either have milliseconds, but no year (in the default format) or the year but no milliseconds (in iso format). I would have thought that exposing as much timing information as possible would be preferred in logs ;)

Because I found this surprising, I figured I make sure this is intentional and not an oversight. Sounds like it is and y'all won't change it unless there's more concrete pressure :)

iliakur avatar Nov 22 '23 09:11 iliakur

@iliakur, thanks for asking and thanks for the context! As a follow up- if were to add an additional format that is say "default with year" - would that be useful / preferred for Datadog?

nnshah1 avatar Nov 22 '23 14:11 nnshah1

@nnshah1 sure! When estimating effort/reward for this bear in mind that our log parser can infer the year almost always correctly (it uses date of the parse, so we'd only run into some edge cases around NYE).

I'll reopen this issue and let you close it with a PR or explicit "won't do" depending on what you end up deciding.

iliakur avatar Nov 23 '23 09:11 iliakur