-
Notifications
You must be signed in to change notification settings - Fork 54k
Adding "Streaming Real-time log to Splunk from Spring boot" | BAEL-8434 #17648
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
Conversation
| <parent> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-parent</artifactId> | ||
| <version>3.3.4</version> | ||
| <relativePath/> <!-- lookup parent from repository --> | ||
| </parent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the logging-modules as the parent POM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated code!
logging-modules/splunk-with-log4j2/src/main/java/com/splunk/log4j/dto/Student.java
Outdated
Show resolved
Hide resolved
logging-modules/splunk-with-log4j2/src/main/java/com/splunk/log4j/dto/Student.java
Outdated
Show resolved
Hide resolved
| studentService.addStudent(student2); | ||
| List<Student> studentList = studentService.getStudents(); | ||
|
|
||
| Student student3=studentList.stream().filter(s -> s.getRollNo()==5).findFirst().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use orElseThrow instead of get
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated code!
| import java.util.List; | ||
|
|
||
| @SpringBootTest | ||
| class StudentServiceUnitTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the file.
logging-modules/splunk-with-log4j2/src/main/java/com/splunk/log4j/dto/Student.java
Outdated
Show resolved
Hide resolved
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JavierPeris ,
I was getting conflicts in the build due to other loggers because there are other submodules in which they have other loggers already (other than log4j2).
Error for reference:
SLF4J(W): Class path contains multiple SLF4J providers. SLF4J(W): Found provider [org.apache.logging.slf4j.SLF4JServiceProvider@64711bf2] SLF4J(W): Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@169da7f2] SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J(I): Actual provider is of type [org.apache.logging.slf4j.SLF4JServiceProvider@64711bf2]
JavierPeris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the files, so the imports be in the correct order.
Hi @JavierPeris , |
JavierPeris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the files. Imports don't have empty lines as separators, fields within a class start with an empty line, etc.
Hi @JavierPeris ,
Could you please review the following PR related to BAEL-8434
Article Draft link: https://drafts.baeldung.com/?p=211934&preview=true