eunomia-bpf / bpftime

Userspace eBPF runtime for Observability, Network & General Extensions Framework
https://eunomia.dev/bpftime/
MIT License
788 stars 74 forks source link

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

Closed Officeyutong closed 1 month ago

Officeyutong commented 5 months ago

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

NobinPegasus commented 5 months ago

@Officeyutong I would like to work on this

NobinPegasus commented 5 months ago

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

Officeyutong commented 5 months ago

@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

yunwei37 commented 5 months ago

@NobinPegasus Any progress?

Kailian-Jacy commented 4 months ago

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:

Officeyutong commented 3 months ago

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!