Skip to content

Conversation

@stephan-gh
Copy link
Contributor

@stephan-gh stephan-gh commented Sep 22, 2017

This is a combination of moving Waterfall to Log4J (related to #139), additional console improvements using TerminalConsoleAppender (see PaperMC/Paper#728) and allowing plugins to use SLF4J (related to PaperMC/Paper#890).

It's similar to #139 but implemented differently. The only thing both PRs have in common is that Log4J2 is used (together with its async logging functionality). Otherwise they are different:

  • TerminalConsoleAppender and JLine 3 are used for console improvements (e.g. colors, command completion, ...). See Improve console implementation Paper#728 for new features introduced by switching.
  • Logged messages are forwarded using a custom Handler instead of Log4J's custom JUL LogManager. This is mostly because Log4J's custom LogManager prevents use of custom handlers attached to the JUL Logger and some plugins may make use of that. It's now similar to what Spigot does to forward them and I think it has shown to work quite well.
  • System.out and System.err are redirected to the logger using Log4J IOStreams

There are two additional commits that are equivalent to the changes in PaperMC/Paper#890. Plugin prefixes are handled using logger names in the Log4J configuration and plugins may now use SLF4J for logging.

As far I can tell, everything is already working correctly but I still need to do some cleanup...

@stephan-gh
Copy link
Contributor Author

As discussed on IRC, I've added a Log4j configuration file that replicates the old BungeeCord setup. It can be enabled by running Waterfall using -Dlog4j.configurationFile=log4j2-bungee.xml. However, the default is a setup that is very similar to what Vanilla/Paper/Sponge/Forge use.

@kashike
Copy link
Member

kashike commented Sep 24, 2017

Thanks, @Minecrell.

@kashike kashike merged commit ab50219 into PaperMC:master Sep 24, 2017
Copy link
Contributor

@jamierocks jamierocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stuff to be done while merging

}
}
- }
+ }*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/ should be on the next line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants