Log files
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)
Probably also a JSON structure for server to return responses should be designed.
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?
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.
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 is500). 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!
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.