Skip to content

Instantly share code, notes, and snippets.

@Linkit123
Created January 9, 2022 16:14
Show Gist options
  • Save Linkit123/15472fa0f1ebbca938ade9208b5454fa to your computer and use it in GitHub Desktop.
Save Linkit123/15472fa0f1ebbca938ade9208b5454fa to your computer and use it in GitHub Desktop.
package com.dvtt.demo.coredemo.thread;
import com.dvtt.demo.coredemo.context.LoggingContext;
public class ThreadContextKeeper {
private static final ThreadLocal<LoggingContext> threadLocalValue = ThreadLocal.withInitial(LoggingContext::new);
public static LoggingContext getRequestAttributes() {
return threadLocalValue.get();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment