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

Logging verbosity #78

Open
Lonerider2010 opened this issue May 17, 2023 · 8 comments
Open

Logging verbosity #78

Lonerider2010 opened this issue May 17, 2023 · 8 comments

Comments

@Lonerider2010
Copy link

Running pyrobox as a systemd service, I would like to know what users are doing. So I redirect the pyrobox output to a log file.
From my point of view that is too verbose.
An example entry (depersonalized):

INFO: 
================================== 10digit-ID ==================================
10digit-ID|=>	 request	: GET
10digit-ID|=>	 url     	: /dir/subdir/
10digit-ID|=>	 query   	: {}
10digit-ID|=>	 fragment	: 
10digit-ID|=>	 full url 	: /dir/subdir/
++++++++++++++++++++++++++++++++++ 10digit-ID ++++++++++++++++++++++++++++++++++
INFO: 
# 10digit-ID by [URL] at [Date time]|=> "GET /dir/subdir/ HTTP/1.1" 200 -

INFO: 
---------------------------------- 10digit-ID ----------------------------------
################################################################################

That's 14 lines of information for one entry. The only information that I really need is line 10 starting with # 10digit-ID by.
This line contains the same information (with small exceptions) as all other lines together.

So I propose that you add a command line option --no-verbose that delivers the information of the aforementioned line 10 only.

Thanks in advance.

@RaSan147
Copy link
Owner

Thanks for the heads u. Since It uses standard logging library, so i thought there was already a CLI based log handler.
I'll implement it asap

Ref: https://stackoverflow.com/questions/57192387/how-to-set-logging-level-from-command-line

@RaSan147
Copy link
Owner

RaSan147 commented May 17, 2023

However the =, + and - has special meanings

= : A request has been received. The request basic data as below
+ : The request handling is working, the log is below
- : The request has been finalized and responded and closing the connection

@Lonerider2010
Copy link
Author

Ok, thanks for this information. From my point of view, the line mentioned by me is still sufficient.
That is very similar to what I get e.g. from the python http.server or the uploadserver which is also based on the http.server.

@RaSan147
Copy link
Owner

Could you kindly rewrite which 10 lines?
Also a word of info,
INFO:
WARNING:
Etc are signs and part of logging, so i don't think I'll remove it. I'll keep checking different opinions

@Lonerider2010
Copy link
Author

Instead of

INFO: 
================================== 10digit-ID ==================================
10digit-ID|=>	 request	: GET
10digit-ID|=>	 url     	: /dir/subdir/
10digit-ID|=>	 query   	: {}
10digit-ID|=>	 fragment	: 
10digit-ID|=>	 full url 	: /dir/subdir/
++++++++++++++++++++++++++++++++++ 10digit-ID ++++++++++++++++++++++++++++++++++
INFO: 
# 10digit-ID by [URL] at [Date time]|=> "GET /dir/subdir/ HTTP/1.1" 200 -

INFO: 
---------------------------------- 10digit-ID ----------------------------------
################################################################################

I would like to get

INFO: # 10digit-ID by [URL] at [Date time]|=> "GET /dir/subdir/ HTTP/1.1" 200 -

only.

@RaSan147
Copy link
Owner

RaSan147 commented May 18, 2023

I think that can be done... I'll look into it
Thanks for the suggestion

@Lonerider2010
Copy link
Author

That sounds good. Thanks for that. You are very activ with your pyrobox, congrats.

@RaSan147
Copy link
Owner

fixed it (locally) soon will be updated (massive update (ui+backend+how server works) coming. please wait a bit

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

No branches or pull requests

2 participants