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

Log files #32

Open
Subtixx opened this issue Feb 3, 2020 · 5 comments
Open

Log files #32

Subtixx opened this issue Feb 3, 2020 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@Subtixx
Copy link
Contributor

Subtixx commented Feb 3, 2020

Add logging capabilities to the ETS2 Job Logger application, this way when something unexpected happens one can simply upload the log file with extended details (For example body of the response)

@Lihis
Copy link
Owner

Lihis commented Feb 3, 2020

Probably also a JSON structure for server to return responses should be designed.

@Subtixx
Copy link
Contributor Author

Subtixx commented Feb 3, 2020

I meant local log files manually shared with the dev of the api/webapp, if the API returned anything other than 200 to get why and when an issue appeared.

Because if you automagically upload that log file, what happens when the automagical log file upload endpoint is also down / has issues?

@Lihis
Copy link
Owner

Lihis commented Feb 3, 2020

Yeah. I were just thinking that in case of response code is not 200, server returns in the response a in a defined JSON blob (except when response code is 500). The returned JSON could include like error message (possibly in user's language) and some other debug message field or code. Error message could be then used in the notification which is shown when job sending fails and additional debug message could be forwarded to the log file.

@Lihis Lihis added the enhancement New feature or request label Feb 3, 2020
@doouz
Copy link
Contributor

doouz commented Feb 3, 2020

Yeah. I were just thinking that in case of response code is not 200, server returns in the response a in a defined JSON blob (except when response code is 500). The returned JSON could include like error message (possibly in user's language) and some other debug message field or code. Error message could be then used in the notification which is shown when job sending fails and additional debug message could be forwarded to the log file.

Sounds great!

@Lihis Lihis added this to the v0.1.0 milestone Feb 5, 2020
@Lihis
Copy link
Owner

Lihis commented Feb 14, 2020

Log file format itself:

[YYYY-MM-DD HH:MM:SS] ENDPOINT - HTTP_CODE: MESSAGE

  • Time in UTC in case users are from multiple time zones.
  • Truncate the log file when program starts so it doesn't grow forever.

Maybe server could return:

{
    "dbg": "Message to log file",
    "error": "Message to display to user"
}

error could be in user's language (e.g. your website has translations).
dbg could be in yours language.

If server returns HTTP code 500 -> to the log file with message Internal Server Error.

Leave your proposals as I don't know what one would want to log.. I haven't done any real server side implementations, just testing against couple line long PHP script with PHP's built-in server.

@Lihis Lihis modified the milestones: v0.1.0, v0.2.0 Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants