bpftime icon indicating copy to clipboard operation
bpftime copied to clipboard

[FEATURE] Make logs (printed from spdlog) sended to trace_pipe on agent

Open Officeyutong opened this issue 1 year ago • 6 comments

We should support that make logs printed from spdlog being sended to trace_pipt, not directly printed from the process injected by agent

Officeyutong avatar Apr 14 '24 10:04 Officeyutong

@Officeyutong I would like to work on this

NobinPegasus avatar Apr 14 '24 19:04 NobinPegasus

@Officeyutong Can you provide some guidelines? Which files should I make the changes to? SPDLOG_* are used in far too many places.

NobinPegasus avatar Apr 17 '24 22:04 NobinPegasus

@Officeyutong Can you provide some guidelines? Which files should I make the changes to? SPDLOG_* are used in far too many places.

Create a new logger, set it to default, and use a customized sink so it could send logs to tracepipe

https://github.com/gabime/spdlog/wiki/2.-Creating-loggers

Officeyutong avatar Apr 18 '24 14:04 Officeyutong

@NobinPegasus Any progress?

yunwei37 avatar May 06 '24 05:05 yunwei37

Hi, I've made a draft pr to this issue with basic logging redirection feature finished:

https://github.com/eunomia-bpf/bpftime/pull/301

There are still some questions too be solved before further works and merging. Please kindly provide suggestions if possible.

I may add these feature in this PR, hoping suggestions or confirmation from you:

  • Provide a subcommand similar to trace to output logs we want.
  • Logs be optionally reserved under /var/log/ or syslog under linux. Log rotation are management automatically.
  • Merge logs from different processes as one. Add tags of source (which injected process causing) to the log.
  • Add documentations about logging.

Kailian-Jacy avatar Jun 03 '24 11:06 Kailian-Jacy

Hi, I've made a draft pr to this issue with basic logging redirection feature finished:

#301

There are still some questions too be solved before further works and merging. Please kindly provide suggestions if possible.

I may add these feature in this PR, hoping suggestions or confirmation from you:

  • Provide a subcommand similar to trace to output logs we want.
  • Logs be optionally reserved under /var/log/ or syslog under linux. Log rotation are management automatically.
  • Merge logs from different processes as one. Add tags of source (which injected process causing) to the log.
  • Add documentations about logging.

These features are ok. Thank you!

Officeyutong avatar Jun 06 '24 09:06 Officeyutong