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

Add Log4J xml parsing #1

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Add Log4J xml parsing #1

merged 1 commit into from
Oct 6, 2022

Conversation

kd8lvt
Copy link
Owner

@kd8lvt kd8lvt commented Oct 5, 2022

Purpose

Log4J xml-spam has been an issue since the RCE exploit that was discovered a while back. It makes logs incredibly difficult to quickly parse, which makes modpack debugging difficult.

Approach

We parse it! To be honest - mine is not the cleanest or quickest solution, but it functions very well, and since we were already using console.log anyways, it doesn't really have to be fast in the first place. Future revisions could probably speed it up quite a lot using regex, but that's beyond my skill in that field.

Open Questions and Pre-Merge TODOs

  • Use github checklists. When solved, check the box and explain the answer.

Learning

Other than double-checking a few things on MDN this was all done from the top of my head, in vanilla JS.

I got tired of trying to decode xml-vomit in my head and made a snippet to paste into the console when opening GDL.
Just decided to commit it so other people can have clean-looking logs too. Tested to work with 1.16+ - not sure about anything older.
@kd8lvt kd8lvt merged commit 5ed6df9 into master Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant