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

Improve application logging out put for error messages #2100

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

abraunegg
Copy link
Owner

  • When enabling system logging to a log file, the actual ERROR line is forced to a new line in the application log. The reason for this is the \n prefix in the error message, which was in place so that when performing CLI logging or systemd logging, the error message would be displayed clearly. This change removes the \n from the actual error message, but inserts a newline before the error message is displayed - thus keeping the application runtime look and feel, but improving the application log output.

* When enabling system logging to a log file, the actual ERROR line is forced to a new line in the application log. The reason for this is the \n prefix in the error message, which was in place so that when performing CLI logging or systemd logging, the error message would be displayed clearly. This change removes the \n from the actual error message, but inserts a newline before the error message is displayed - thus keeping the application runtime look and feel, but improving the application log output.
@abraunegg abraunegg added this to the v2.4.21 milestone Aug 17, 2022
@abraunegg
Copy link
Owner Author

Without PR:

2022-Aug-18 06:02:29.9035923    Processing 1 OneDrive items to ensure consistent local state due to a full scan being requested
2022-Aug-18 06:02:29.9058892    Sync with OneDrive is complete
2022-Aug-18 06:03:49.9257259    [M] Local file changed: ./new_local.file
2022-Aug-18 06:03:50.8064351    OneDrive returned a 'HTTP 403 - Forbidden' - gracefully handling error
2022-Aug-18 06:03:50.8068652    Uploading new file ./new_local.file ... skipped.
2022-Aug-18 06:03:50.8070152
ERROR: Microsoft OneDrive API returned an error with the following message:
2022-Aug-18 06:03:50.807177       Error Message:    HTTP request returned status code 403 (Forbidden)
2022-Aug-18 06:03:50.8076377      Error Reason:     Access Denied
2022-Aug-18 06:03:50.807802       Error Timestamp:  2022-08-17T20:03:50
2022-Aug-18 06:03:50.8079574      API Request ID:   f6965c58-b26f-4ed8-8214-90783702d241
2022-Aug-18 06:03:50.8081199      Calling Function: uploadNewFile()

2022-Aug-18 06:04:01.9141278    Got termination signal, performing clean up
2022-Aug-18 06:04:01.914455     Shutting down the HTTP instance
2022-Aug-18 06:04:01.915962     Shutting down db connection and merging temporary data

With PR:

2022-Aug-18 09:11:04.4086543    Uploading new file ./new_local.file ... skipped.
2022-Aug-18 09:11:04.4088614    ERROR: Microsoft OneDrive API returned an error with the following message:
2022-Aug-18 09:11:04.4090451      Error Message:    HTTP request returned status code 403 (Forbidden)
2022-Aug-18 09:11:04.409307       Error Reason:     Access Denied
2022-Aug-18 09:11:04.4094522      Error Timestamp:  2022-08-17T23:11:04
2022-Aug-18 09:11:04.4096193      API Request ID:   caa23e45-fdfa-43ac-8da8-3b56b139d14f
2022-Aug-18 09:11:04.4097741      Calling Function: uploadNewFile()

@abraunegg abraunegg merged commit d169dfc into master Aug 17, 2022
@abraunegg abraunegg deleted the fix-logging-error-on-next-line branch August 17, 2022 23:14
@abraunegg
Copy link
Owner Author

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Repository owner locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant