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

Log improvements #194

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,17 @@ appender.console.name = consoleLogger
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %notEmpty{[%X{restateServiceMethod}]}%notEmpty{[%X{restateInvocationId}]} %c - %m%n

# Filter out logging during replay
appender.console.filter.replay.type = ContextMapFilter
appender.console.filter.replay.onMatch = DENY
appender.console.filter.replay.onMismatch = NEUTRAL
appender.console.filter.replay.0.type = KeyValuePair
appender.console.filter.replay.0.key = restateInvocationStatus
appender.console.filter.replay.0.value = REPLAYING

# Restate logs to debug level
logger.app.name = dev.restate
logger.app.level = debug
logger.app.level = info
logger.app.additivity = false
logger.app.appenderRef.console.ref = consoleLogger

Expand Down
12 changes: 10 additions & 2 deletions examples/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ status = warn
appender.console.type = Console
appender.console.name = consoleLogger
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %notEmpty{[%X{restateServiceMethod}]}%notEmpty{[%X{restateInvocationId}]}%notEmpty{[%X{restateInvocationStatus}]} %c - %m%n
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %notEmpty{[%X{restateServiceMethod}]}%notEmpty{[%X{restateInvocationId}]} %c - %m%n

# Filter out logging during replay
appender.console.filter.replay.type = ContextMapFilter
appender.console.filter.replay.onMatch = DENY
appender.console.filter.replay.onMismatch = NEUTRAL
appender.console.filter.replay.0.type = KeyValuePair
appender.console.filter.replay.0.key = restateInvocationStatus
appender.console.filter.replay.0.value = REPLAYING

# Restate logs to debug level
logger.app.name = dev.restate
logger.app.level = debug
logger.app.level = info
logger.app.additivity = false
logger.app.appenderRef.console.ref = consoleLogger

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void onStart(MessageLite msg) {
void close() {
if (this.invocationState != InvocationState.CLOSED) {
this.transitionState(InvocationState.CLOSED);
LOG.debug("Closing state machine");
LOG.info("Stopped processing invocation");

// Cancel inputSubscription and complete outputSubscriber
if (inputSubscription != null) {
Expand All @@ -227,7 +227,7 @@ void close() {
void fail(Throwable cause) {
if (this.invocationState != InvocationState.CLOSED) {
this.transitionState(InvocationState.CLOSED);
LOG.debug("Closing state machine with failure", cause);
LOG.warn("Stopped processing invocation with failure", cause);

// Cancel inputSubscription and complete outputSubscriber
if (inputSubscription != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public InvocationFlow.InvocationOutputPublisher output() {

@Override
public void start() {
LOG.debug("Start processing call to {}/{}", serviceName, methodName);
LOG.info("Start processing invocation");
stateMachine.start(
invocationId -> {
// Set invocation id in logging context
Expand Down
Loading