mail-server icon indicating copy to clipboard operation
mail-server copied to clipboard

[bug]: viewing logs in the web interface hardcodes a logger with id = log

Open landryb opened this issue 10 months ago • 3 comments

What happened?

trying 0.7.1, viewing logs in the web UI only works if i've configured a logger with the id log, as it's harcoded here: https://github.com/stalwartlabs/mail-server/blob/main/crates/jmap/src/api/management/log.rs#L31

in my understanding, it should look for a logger with type = log and use the corresponding path.

How can we reproduce the problem?

I can reproduce the problem by doing the following steps:

  • configure a file logger with an id != 'log'
  • try to view logs in the web interface
  • an error message is shown

Version

v0.7.x

What database are you using?

RocksDB

What blob storage are you using?

RocksDB

Where is your directory located?

Internal

What operating system are you using?

None

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

landryb avatar Apr 14 '24 10:04 landryb

The log viewer is a temporary feature that was created to allow users view their logs without having to SSH into the server. In addition to the log tracer id being hardcoded, the parser will break if you enable ANSI colors in the log output.

Since displaying and searching text files is not efficient, the text file log viewer is going to be removed once Stalwart's own logger is implemented.

mdecimus avatar Apr 14 '24 18:04 mdecimus

i agree with you that it's not efficient to display/parse/manage log files in a web interface, but it might be a handy feature for users :) should this issue be closed then ? you plan to put logs in the blobstore too ?

landryb avatar Apr 16 '24 13:04 landryb

Still need to research where they will be stored but not on the blob store as it does not support searches. We can keep this open until the new logging facility is implemented.

mdecimus avatar Apr 19 '24 13:04 mdecimus