Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: info log being redirected to /var/log/syslog file #2171

Closed
himu007 opened this issue Dec 7, 2022 · 3 comments · Fixed by #2201
Closed

[BUG]: info log being redirected to /var/log/syslog file #2171

himu007 opened this issue Dec 7, 2022 · 3 comments · Fixed by #2201
Labels
bug Something isn't working P0 Blocker / critical defect

Comments

@himu007
Copy link

himu007 commented Dec 7, 2022

Describe the bug
The latest desktop version 0.5.7 redirecting & displaying info logs in /var/log/syslog file. The syslog file is mostly for the system info which is great to find critical info about the system. App logs has specific path or atomicDEX even can create a subdir inside /var/log dir if that is the desired place. However, there is already another dir /home/USER/.atomic_qt/logs where atomicDEX logs and mm2 logs being written. So, writing atomicDEX logs in syslog file doesn't make sense and this increases the syslog file size dramatically.

To Reproduce
Steps to reproduce the behavior:
Type the following while atomicDEX instance is running in a system and logged in (like an user would do)

tail -f /var/log/syslog

Expected behavior
No atomicDEX logs in the syslog file and keep atomicDEX logs file inside /home/USER/.atomic_qt/logs/ dir.

Operating Environment(s):

Additional context
Sample from the syslog file

Dec  7 21:46:39 local org.gnome.Nautilus[8055]: [21:46:39] [info] [band.provider.cpp:54] [8055]: start fetching oracle
Dec  7 21:46:39 local org.gnome.Nautilus[8055]: [21:46:39] [error] [cpprestsdk.utilities.cpp:51] [8100]: pplx task error: Error resolving address
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:182] [8055]: 2min spend - refreshing provider
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:443] [8055]: Forcing update providers
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:105] [8092]: refresh_other_coins_rates - try 1
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: message repeated 2 times: [ [21:46:40] [info] [global.provider.cpp:105] [8092]: refresh_other_coins_rates - try 1]
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:482] [8092]: Successfully retrieving rate after 1 try
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:140] [8097]: Successfully get the coinpaprika::api::async_price_converter answer after 1 try
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:140] [8083]: Successfully get the coinpaprika::api::async_price_converter answer after 1 try
Dec  7 21:46:40 local org.gnome.Nautilus[8055]: [21:46:40] [info] [global.provider.cpp:140] [8064]: Successfully get the coinpaprika::api::async_price_converter answer after 1 try
Dec  7 21:46:41 local org.gnome.Nautilus[8055]: [21:46:41] [info] [internet.checker.service.cpp:173] [8055]: mm2 is alive, checking if ware able to fetch a simple orderbook
Dec  7 21:46:41 local org.gnome.Nautilus[8055]: [21:46:41] [info] [internet.checker.service.cpp:130] [8074]: Connectivity is true for the endpoint: http://127.0.0.1:7783
Dec  7 21:46:44 local org.gnome.Nautilus[8055]: [21:46:44] [info] [rpc.best.orders.cpp:34] [8055]: getting bestorders data...
Dec  7 21:46:44 local org.gnome.Nautilus[8055]: [21:46:44] [info] [komodo.prices.provider.cpp:35] [8055]: komodo price service tick loop
Dec  7 21:46:44 local org.gnome.Nautilus[8055]: [21:46:44] [info] [komodo.prices.cpp:82] [8055]: url: https://prices.komodo.live:1313/api/v2/tickers?expire_at=21600
Dec  7 21:46:44 local org.gnome.Nautilus[8055]: [21:46:44] [info] [komodo.prices.provider.cpp:48] [8076]: komodo price registry size: 225
Dec  7 21:46:44 local org.gnome.Nautilus[8055]: [21:46:44] [info] [qt.portfolio.page.cpp:103] [8076]: Updating portfolio values with model: true
@himu007 himu007 added the bug Something isn't working label Dec 7, 2022
@smk762 smk762 assigned ghost Dec 8, 2022
@ghost ghost added the P0 Blocker / critical defect label Dec 8, 2022
@tonymorony
Copy link

That should be fixed by 9990759

@smk762 could QA please re-check?

@smk762
Copy link
Collaborator

smk762 commented Jan 21, 2023

That should be fixed by 9990759

That commit should make it so that when building with -DCMAKE_BUILD_TYPE=Release there should not be any logs seen with [debug] prefix, and it works in both console and syslog.

The syslog issue is a bit stranger though. It only happens when launched from file manager, not from CLI. Testing some other AppImages for other apps I've had downloaded exhibited the same behaviour.

The app uses spdlog which should not put logs into syslog unless using with spdlog::syslog_logger_mt. syslog does not appear anywhere in the repo code.

The logs shown in syslog are prefixed with
org.gnome.Nautilus[8055] (or in my case org.freedesktop.FileManager1[2638142]) which looks like it is the file manager sending the console logs to syslog. I'm not sure if this is expected behaviour or how to suppress it without also suppressing console logs.

@smk762
Copy link
Collaborator

smk762 commented Jan 21, 2023

If we remove stdout_sink from https://github.com/KomodoPlatform/atomicDEX-Desktop/blob/dev/src/app/main.prerequisites.hpp#L183 all except the earliest logs will not show up in console or syslog (but still go to file).

The logs it misses are

[2023-01-21 10:59:39.977] [info] [main.prerequisites.hpp:355] Installing qt_message_handler
[2023-01-21 10:59:39.978] [info] [main.prerequisites.hpp:360] SSL: true OpenSSL 1.1.1g  21 Apr 2020 OpenSSL 1.1.1f  31 Mar 2020
mm2: no process found

The first two we can simply delete. The third is a response from https://github.com/KomodoPlatform/atomicDEX-Desktop/blob/dev/src/core/atomicdex/utilities/kill.cpp#L29 which we could handle better by checking if a process exists before going in for the kill.

Personally, I like my console logs, even if they end up in syslog. We could make the console logging suppressed for Release tho, and keep it active in debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Blocker / critical defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants