Minecraft.How
Lädt...
Zum Inhalt springen

Async Logger

von decce6

Async Logger makes Minecraft's logging asynchronous and adds config-based log filtering. It's a client-side mod with builds for Fabric, Forge and NeoForge.

Unsere Zusammenfassung

Was dieses Projekt macht

What it does

Async Logger changes how Minecraft handles its log output. In vanilla, the real logging work happens on the logging thread, and that includes the I/O. This mod switches to asynchronous loggers, so the work no longer happens there.

It's a client-side mod. The Modrinth page lists client side as required and server side as unsupported. Its categories are Performance and Utility & Quality of Life, and it's licensed under the GNU Lesser General Public License v3.0 only.

Who it suits

The project says the change is most useful when a lot of messages are being logged, or when debug logging is switched on. Debug logging is the default on Forge and NeoForge. So if you play on one of those loaders and your log fills up fast, you're the person it's aimed at.

It also suits anyone who just wants a cleaner log file. More on that below.

Benchmarks from the project

The author publishes a comparison between vanilla and the mod. Ten thousand simple messages took 6146.1 ms in vanilla and 141.2 ms with Async Logger. Ten thousand messages with placeholders took 6413.2 ms and 96.6 ms. For 1,500 messages with a throwable, the figures were 19572.4 ms and 9.0 ms.

Those are the project's own test numbers for logging calls. They aren't a promise about frame rate or anything else in the game.

You can run the test yourself. Turn on testPerformance in the config. Here's the thing, the mod then logs a large batch of messages before and after it sets up the async loggers, and you read the results in the log.

Log filtering

The mod can also filter what gets logged. Set filtering.enabled to true in the config, then edit one or more of the filters. You can filter by logger name, by level, or by message. Message filters match a substring or a regular expression.

Filtering runs on the dedicated async logger thread. According to the project, that means the caller sees no overhead from it.

Technical notes

The mod uses asynchronous loggers instead of asynchronous appenders. The project describes the former as newer, faster and lighter on allocation rate.

Asynchronous loggers need LMAX Disruptor, a lock-free library for communication between threads. If it isn't already present, the mod loads it onto the system classloader. The mod redistributes LMAX Disruptor under the Apache-2.0 License.

The config file gives you control over some log4j2 settings. You can also redirect System.out and System.err to loggers.

Loaders and Minecraft versions

The supported mod loaders are NeoForge, Fabric and Forge.

The Minecraft versions listed are 26.1.2, 26.1.1, 26.1, 26.2, 26.3, 1.21.11, 1.21.10, 1.21.9, 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19 and 1.18.2. Treat that as the full list. Anything not named there isn't confirmed.

Because the mod is client side only, don't expect it to do anything on a dedicated server. The project lists server side as unsupported.

Reaktionen

Melde dich an, um zu reagieren.

Kompatibilität

Versionen und Loader

8 Releases erfasst

Galerie

Async Logger icon

Wir verwenden Cookies, um dein Erlebnis zu verbessern. Wenn du diese Website weiterhin nutzt, stimmst du unserer Verwendung von Cookies zu. Lies unsere Datenschutzrichtlinie