
The primary motivation is that I use SEQ for logging, but I couldn't find a quick complete guide to use SEQ with java spring boot using gradle. So here I'm documenting my findings.
Steps
I'm using this configuration for the project
Add these tobuild.gradle
for dependency
repositories { ... maven { url 'https://jitpack.io' }}dependencies { ... implementation 'com.github.serilogj:serilogj:v0.6.1'}
Now just configure the logger
// import serilogj.Log;// import serilogj.LoggerConfiguration;// import serilogj.events.LogEventLevel;// import static serilogj.sinks.seq.SeqSinkConfigurator.seq;// setting up the loggerLog.setLogger(new LoggerConfiguration() .writeTo(seq("http://localhost:5341/")) .setMinimumLevel(LogEventLevel.Verbose) .createLogger());// using the loggervar logger = Log.getLogger().forContext(SpringApplication.class);logger.information("Hello World");
With this setup the logger should work
You can find the codehere
Reference
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse