Skip to content

Commit

Permalink
chore(log): separate stream log into dedicated file (#544)
Browse files Browse the repository at this point in the history
Signed-off-by: SSpirits <[email protected]>
  • Loading branch information
ShadowySpirits authored Nov 2, 2023
1 parent 90cc1cf commit 6ceeed3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions broker/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@
<SizeBasedTriggeringPolicy size="100MB" />
<DefaultRolloverStrategy max="10"/>
</RollingFile>

<RollingFile name="streamAppender" fileName="${LOG_DIR}/stream.log" filePattern="${LOG_DIR}/stream.%i.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %m%n"/>
<SizeBasedTriggeringPolicy size="100MB"/>
<DefaultRolloverStrategy max="10"/>
</RollingFile>
</Appenders>

<Loggers>
<Logger name="com.automq.rocketmq.controller" level="info" additivity="false">
<AppenderRef ref="controllerAppender" />
</Logger>
<Logger name="com.automq.stream" level="info" additivity="false">
<AppenderRef ref="streamAppender"/>
</Logger>
<Root level="info">
<AppenderRef ref="rollingFile"/>
</Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public static List<Pair<InstrumentSelector, View>> getMetricsView() {
(double) Duration.ofNanos(1000).toNanos(),
(double) Duration.ofNanos(10_000).toNanos(),
(double) Duration.ofMillis(1).toNanos(),
(double) Duration.ofMillis(2).toNanos(),
(double) Duration.ofMillis(3).toNanos(),
(double) Duration.ofMillis(5).toNanos(),
(double) Duration.ofMillis(7).toNanos(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public CompletableFuture<CommitWALObjectResponse> commitWALObject(CommitWALObjec
return streamObjectBuilder.build();
}).toList();

LOGGER.info("Commit WAL object: {}, along with split stream objects: {}, compacted objects: {}",
LOGGER.debug("Commit WAL object: {}, along with split stream objects: {}, compacted objects: {}",
walObject, streamObjects, request.getCompactedObjectIds());

// Build compacted objects
Expand Down

0 comments on commit 6ceeed3

Please sign in to comment.