Thank you all for supporting this project
Optilog needs Java 11+
This is an open source logging framework written in Java language. It has more advantages than other open source logging frameworks (such as Log4j and SLF4j)
The wiki of optilog will be updated at any time. Problems or bugs will be raised on issues or discussions.
Be sure to read the wiki of this project before using it
If you like, you are welcome to contribute to optilog through fork. The code of this project is quite basic, and anyone can contribute.
-
High performance: After initialization, another log (output to the screen + output to a file + output to the server through socket) can be output as fast as 8 milliseconds (it will be optimized later). Optilog is a synchronous log, which has no delay at all, and there is no need to consider the problem of multithreaded atomic operations. Optilog occupies slightly less memory than log4j, and one log output takes about 502344 bytes. Only output to screen+file in ideal state only takes 6 milliseconds
-
Placeholder convenience: optilog supports unlimited placeholders and can be reused (#1 #1 outputs the first placeholder twice). Log4j only supports 9 placeholders.
-
Configuration file can be placed in any location. The name of the configuration file is unlimited. Two types of configuration files are supported. In log4j, the configuration file can only be in classpath and the name can only be log4j2 xml.
-
Support the client to send logs to Server.
-
All possible exceptions in Optilog are basically captured without affecting the main logic.
-
You only need one jar package, and you can use it directly by typing in the classpath (I don't know the feeling of adding dozens of jar packages at once when using gradle).
-
Suitable for beginners without complex configuration files.
-
Few dependence.
-
Class, method and other information output in the log are absolutely accurate, because Optilog uses StackTraceElement internally to determine that information, and there is no need to write the class instance when initializing the log.
-
Optilog can directly generate a default configuration file. Beginners do not need to look for the configuration file example (Tutorial)
-
Support configuration files in multiple formats, including JSON, yaml, XML and properties. Support for .toml configuration files will be added later.
-
Optilog supports configuration modification during runtime. Of course, only some configuration items of true and false can be modified. Output file paths cannot be modified(Related functions will be added in the future. Things like packingFormat can be modified directly. If you really want to modify the output path, you may need to reInitialize it internally).
-
Support outputting logs to JDBC.
Generate by carbon.now.sh
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.3
org.yaml:snakeyaml:1.30
mysql:mysql-connector-java:8.0.29
mysql:mysql-connector-java:8.0.29
(You needn't add dependency if you don't use these function.)
JavauserO
realize remote call