IDLua icon indicating copy to clipboard operation
IDLua copied to clipboard

Please don't override log4j configuration in IDE

Open ForNeVeR opened this issue 4 years ago • 1 comments

While investigating #22, we've found the root cause of the issue: it's the log.xml configuration file which is loaded by the LuaLoggerManager component: https://github.com/sylvanaar/IDLua/blob/ffc0589fca36b1837895cbf99f8ef3870ce1b685/src/main/java/com/sylvanaar/idea/Lua/LuaLogManager.java#L26-L35

(note that, while this component is disabled in the source code of the plugin, it is, nevertheless, enabled in the plugin builds uploaded to the Marketplace, which I've already reported as #26)

This log.xml configures the following appender: https://github.com/sylvanaar/IDLua/blob/ffc0589fca36b1837895cbf99f8ef3870ce1b685/include/log.xml#L5-L13

This appender just passes logs with WARN level to the process' stderr.

At the same time, Rider (for reasons beyond the scope of current investigation) has a special mechanism that does a reverse thing: takes its stderr and passes back to logger.

So, any log with the WARN level will get passed to the logger, which will try to write it into stderr, which will get mirrored back to the logger, etc. etc., which will either cause a stack overflow or out of memory error (we've encountered both during the investigation).

While this particular issue will likely be fixed in Rider 2021.1, it isn't recommended to change the IDE log settings from the plugin. Instead of that, please use the IDE logging system as-is and use the IDE debug log settings (available in Help → Diagnostic Tools → Debug Log Settings… main menu item) if you want to enable / disable logging on the go.

ForNeVeR avatar Jan 25 '21 14:01 ForNeVeR

I just noticed that the IDEA would now log all DEBUG level logs after enabling the Lua plugin. It seems this log problem is also caused by this issue.

floating-cat avatar Feb 02 '21 05:02 floating-cat