Questions tagged [spring-logback]

288 questions
2
votes
0 answers

Creating a log file for each and every test case with executed test case name

I need to create a log file for each test that runs. I was looking here and there and came up with this, but I am still getting this file: logFileName_IS_UNDEFINED.log where all log is stored but also I have new log files created, but they are…
Ann
  • 57
  • 3
  • 9
2
votes
0 answers

Converting logback.xml to application.properties

How can I convert logback.xml file to properties? For example, there is such a configuration file or the code I have attached below. I need to write similar properties in application.properties Are there examples for such configurations? is it…
AlexPopov
  • 87
  • 8
2
votes
0 answers

LogstashTcpSocketAppender in logback-spring.xml doesn't send logs to ELK But works in Java based approach

Inspired by this Java class approach I am trying an XML based approach for sending logs to ELK directly through logback-spring.xml. This fails and the logs don't reach ELK. What could be the reason?Any help would be deeply…
raikumardipak
  • 1,461
  • 2
  • 29
  • 49
2
votes
0 answers

Create custom log level in Spring boot logback-spring.xml

Team, I want to be create custom log level in logback-spring.xml in spring boot. like we have info, debug,warn same like want to create my own custom level. any suggestion ?
2
votes
0 answers

Spring Testing: Disable logging of, e.g., SpringJUnit4ClassRunner

Before a test is run Spring logs some messages with DEBUG level: 16:34:47.177 [Test worker] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class…
matthjes
  • 671
  • 7
  • 20
2
votes
0 answers

logback-spring.xml file configuration does not delete old archived files

I got stuck at a point where I was configuring my logback-spring.xml file. The problem is that my old archived files are not deleted, but Spring boot recognizes the xml file. I can see the changes when I change the e.g. maxFileSize parameter. Only…
KingO
  • 51
  • 3
2
votes
1 answer

Spring-Boot include build-info as SpringProperty in Logback

I'm using SpringBoot 2.1 with the spring-boot-maven-plugin and git-commit-id-plugin to automatically populate the actuator info endpoint with the build information. Works great. I'm getting the values grouped under the json properites build and…
Leikingo
  • 890
  • 3
  • 10
  • 23
2
votes
1 answer

Spring boot application - how to print logs in Json format

I need to print logs in pretty Json format, with all details. Currently I have my small service on spring boot and application.yml configuration file. I have below configuration for logging; logging: level: root: INFO org: …
liotur
  • 809
  • 2
  • 17
  • 36
2
votes
1 answer

Why spring boot batch application does not print to console?

I am using sprint boot starter with spring batch. I log everything to log file and console. I use annotation as @Slf4j in class level with lomback. In the log file everythings is ok but noting comes out of console. I use perl file which starts the…
itro
  • 7,006
  • 27
  • 78
  • 121
2
votes
1 answer

Logback: test if property is defined

In a Spring Boot / Logback project, I want to check if a system property is set to use a given appender or not. My code is: ....
Rolintocour
  • 2,934
  • 4
  • 32
  • 63
2
votes
3 answers

How to show the contents of log file in browser screen using Spring Actuator?

I'm trying to show the contents of a logger file in the browser screen , so that when the application is running in production in external server, i don't need to login every time into the server to fetch the logs. I'm trying to achieve this using…
Pradeep Anand
  • 145
  • 3
  • 14
2
votes
0 answers

Spring Boot – Configure Log Level in run time using actuator endpoint for multiple instance of microservices

I need to enable dynamic log level changes for my spring microservices using actuator endpoint for multiple instance of microservices .
2
votes
0 answers

How to inject Logback loglevel from property file when using logback-spring.xml

I am using Spring Boot with logback-spring.xml. Currently defining loglevel in logback-spring.xml as hard coded value. I need to inject this value from a application property file. Need to define loglevel value INFO/ERROR in property file or Spring…
springbootlearner
  • 1,220
  • 4
  • 26
  • 48
2
votes
1 answer

Can I Use Logback.xml To Speak to Two Loggers

So we have a somewhat unique situation in that we have a company logger that gets instantiated with the LoggerFactory.getLogger and the class name and then is passed a logging number, throwable exception and the message. This goes to the company…
Patrick Aquilone
  • 584
  • 2
  • 11
  • 28
2
votes
1 answer

ANSI logging with Spring Boot

I use Logback logging with Spring Boot 1.5.15. Looking at the documentation I should be able to disable the ANSI logging (colour output) using the configuration spring.output.ansi.enabled=never. This appears to work fine in the local console however…
nixgadget
  • 6,983
  • 16
  • 70
  • 103