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

override logging format of websocket package to use OpenRVDAS format #415

Open
webbpinner opened this issue Jan 22, 2025 · 5 comments
Open
Assignees
Labels

Comments

@webbpinner
Copy link
Contributor

webbpinner commented Jan 22, 2025

log format used by cached_data_server.py differs from standard OpenRVDAS log format.
Image

Notice timestamp is removed from some messages.

Request that format be consistent with other OpenRVDAS log messages.

@davidpablocohn davidpablocohn self-assigned this Jan 22, 2025
@davidpablocohn
Copy link
Collaborator

This is turning out to be a more subtle bug than I expected. The cached_data_server does have a standard logging format defined, but something in its includes is pre-empting and scuttling it. Still investigating.

@davidpablocohn
Copy link
Collaborator

Okay - fixed in the branch. But it looks like there are two "standard" logging formats:

2025-01-24 17:20:57,760Z 20 INFO cached_data_server.py:1102 Starting CachedDataServer
2025-01-24 17:20:57,761Z 20 INFO cached_data_server.py:960 Starting WebSocketServer on port 8766
2025-01-24 17:20:57,767Z 20 INFO server.py:707 server listening on 0.0.0.0:8766
2025-01-24 17:20:57,767Z 20 INFO server.py:707 server listening on [::]:8766

and

2025-01-24 17:19:18,877 cached_data_server.py:1103 Starting CachedDataServer
2025-01-24 17:19:18,878 cached_data_server.py:961 Starting WebSocketServer on port 8766
2025-01-24 17:19:18,884 server.py:707 server listening on [::]:8766
2025-01-24 17:19:18,884 server.py:707 server listening on 0.0.0.0:8766

If I move us toward one or the other, which do you think is the right one?

@webbpinner
Copy link
Contributor Author

I personally like the one with the log level (the top one).

My rational...
This issue was first raised by SOI who are starting to analyze logs using 3rd-party tools. Having the log level helps to easily classify the nature of the message (INFO, WARNING, ERROR, CRITICAL, DEBUG).

That said... what does the "20" column represent?

@davidpablocohn
Copy link
Collaborator

davidpablocohn commented Jan 25, 2025 via email

@webbpinner
Copy link
Contributor Author

I vote this move forward using the current format definition as defined in logger/utils/stderr_logging.py. Users can override if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants