server
server copied to clipboard
Include year in triton server logs
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:
Iis the log level1011is 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.
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 thanks for the quick response, duly noted! any reason why the default format doesn't include a year?
any reason why the default format doesn't include a year?
Maybe @GuanLuo or @nnshah1 might know more about this.
@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?
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, 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 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.