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

Questions about Chronicle Logger #138

Open
joaovictor720 opened this issue Aug 19, 2024 · 0 comments
Open

Questions about Chronicle Logger #138

joaovictor720 opened this issue Aug 19, 2024 · 0 comments

Comments

@joaovictor720
Copy link

joaovictor720 commented Aug 19, 2024

Hello,

First of all, I would like to apologize if this is not the appropriate space for asking the question below. Unfortunately, me and my team couldn't find any specific forums or documentation regarding Chronicle Logger other than https://javadoc.io/doc/net.openhft/chronicle-logger/4.0.0/index.html (which has little to no description of configuration and usage).

How to properly configure Chronicle Logger for performance?
@hendrikebbers also had some trouble in configuring/using this logger, as stated in issue #130. One PR was sent out to fix this on his repo, but it is not really clear what changes made it faster, since there was only one commit.

The main parts of our pom.xml are:

<dependency>
	<dependency>
		<groupId>net.openhft</groupId>
		<artifactId>chronicle-logger-log4j-2</artifactId>
		<version>4.26ea1-SNAPSHOT</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-api</artifactId>
		<version>2.14.1</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.14.1</version>
	</dependency>
	<!-- Other dependencies... -->
</dependencies>
<build>
	<!-- Resources... -->
	<plugins>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>exec-maven-plugin</artifactId>
			<version>1.2.1</version>
			<configuration>
				<mainClass>com.myproject.Main</mainClass>
				<jvmArgsAppend>
				<arg>--add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --illegal-access=permit --add-exports java.base/jdk.internal.ref=ALL-UNNAMED</arg>
				</jvmArgsAppend>
			</configuration>
		</plugin>
	</plugins>
</build>

Our Log4j's configuration file (log4j2.xml) is:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration  status="WARN">
	<Appenders>
		<File  name="MainFileAppender"  fileName="logs/mainlog.log">
			<PatternLayout>
			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level- %msg%n</pattern>
			</PatternLayout>
		</File>
		<Chronicle  name="CHRONICLE">
			<path>logs</path>
			<chronicleCfg>
				<blockSize>256</blockSize>
				<bufferCapacity>512</bufferCapacity>
			</chronicleCfg>
		</Chronicle>
	</Appenders>
	<Loggers>
		<Logger  name="log4jlogger"  level="DEBUG">
			<appender-ref  ref="MainFileAppender"/>
		</Logger>
		<Root  level="DEBUG">
			<AppenderRef  ref="MainFileAppender"/>
		</Root>
		<Logger  name="chronicle"  level="trace"  additivity="false">
			<appender-ref  ref="CHRONICLE"/>
		</Logger>
	</Loggers>
</Configuration>

Is there any documentation we could check to clarify this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant