-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Support for JSON Format in ULS Logs #66
Comments
Hi @sethumadhav07, sorry for the delay in my reply - I have just returned from OOO. You are correct, a "JSON" formatted log output would in deed make a lot more sense for logging systems. I will have a look at how much work this would involve. As it is not a vital function of ULS, it might take a while until the fix makes it into an active sprint. Best |
Thanks. It would be nice if it can be done soon. SAP uses Akamai products (for e.g Akamai EAA), and it would be nice to have this feature to fulfill our compliance needs. |
ACK, I just had a look at the codebase and it seemed to be just a minor change in the logging format. You can enable the "json" log output either by using the "--json-log" command line argument or by setting the "ULS_JSONLOG=True" ENV var. Please give it a shot if this solves the above enhancement request. Best |
Hi Mike, The JSON output generated by the current flag is quite useful, but in our use case, it's not entirely sufficient for ingestion into Kibana. Kibana expects certain default fields to be present and populated for the logs to be processed correctly. It would be really helpful if we could have the ability to transform the ULS logs so that we can add our own default fields alongside the existing ones. Specifically, it would be great if the timestamp value could be mapped to a different field, such as For our use case, the following fields need to be present in the JSON logs for successful ingestion into Kibana:
Please let me know if you need any additional details or examples to clarify the requirements. |
Hey @sethumadhav07 , I've added another "flag" into the development branch, that should actually give you full control of how the logs look like:
Please read the following doc for a full wrap up on how to use the log formatting option. As this line overwrites plain text AND the json format, you don't need necessarily set the Please have a look and let me know if this suits your requirements ;) Best regards & a happy weekend |
Hi @MikeSchiessl, This looks great and meets our requirements. One suggestion: it would be beneficial to add a flag for setting the date format for the timestamp. The |
Hi @sethumadhav07 , thanks for confirming. I am happy to hear that the provided approach suits your requirements. Besides the format addition, are you ok to close this ticket ? Best regards |
I would like to know the release date of ULS 1.8.0? I appreciate your prompt response. Yes, this ticket can be closed. |
We have not yet planned an official date but I would say it's safe to expect it somewhere mid / end next week or the beginning /mid of the week after the next. This all depends a little on other things floating around my desk and I wanted to chuck in one or two additional things i had in mind. Thanks for confirming the closure - let me know if you have any other issues on the ULS topic |
Sure Thanks |
FYI: I have added the additional datefmt feature to the development branch. |
ULS 1.8.0 is out since yesterday ! Thanks again for contributing with your feature requests. |
Thanks @MikeSchiessl for the update. Appreciate the quick response for resolving this issue. |
Is your feature request related to a problem? Please describe.
Currently, the ULS logs are displayed in a plain text format, which limits their usability with third-party integrations like Kibana. Integrating these logs with Kibana requires them to be in JSON format, which can include mandatory fields populated with certain values for proper ingestion.
Example of current log format:
Describe the solution you'd like
We would like the ULS logs to support JSON format output. This change would enable the logs to be sent to and ingested by third-party integrations such as Kibana more effectively. Additionally, it would be beneficial to support adding a few custom fields to the JSON logs to meet Kibana's mandatory field requirements for our use case.
Describe alternatives you've considered
An alternative could be using an external log parser to convert the current plain text logs into JSON format before sending them to Kibana. However, this adds complexity and overhead, and it's not as efficient or straightforward as having native JSON support in the ULS logs.
Additional context
Supporting JSON format directly within ULS logs would streamline integration with tools like Kibana and enhance log analysis and monitoring capabilities.
Below is a sample of how the JSON log format might look:
{
"timestamp": "2024-08-06T05:37:43.988Z",
"log_level": "Debug",
"component": "ULS",
"message": "Logging initialized",
"host": "XXXX",
"app": "EAA"
}
The text was updated successfully, but these errors were encountered: