Spring boot-hibernate logging on wildfly 10.0.0 - spring

I'm trying setup logging for hibernate with spring boot. I have deployed a few wars with spring boot dependencies in Wildfly. What I want to do is setup logging sql queries only for one of one war, so i add below lines in specific application.properties file:
logging.level.org.hibernate=info
logging.level.org.hibernate.SQL=debug
But unfortunately logging level have changed for all applications.
Is there any way to accomplish what I need ?
Thanks in advance.

Related

Spring boot sleuth no traces in zipkin

we are trying to use sleuth to send logs to zipkin. We are using spring boot '2.2.6.RELEASE' and cloud version Hoxton.RELEASE. I have added below dependencies
implementation "org.springframework.cloud:spring-cloud-starter-zipkin:2.2.6.RELEASE"
implementation "org.springframework.cloud:spring-cloud-starter-sleuth:2.2.6.RELEASE"
implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin:2.2.6.RELEASE"
And added below props in logback.xml
[%X{traceId} %X{spanId} %X{X-Span-Export}]
With the above changes in our 2 services, we were expecting zipkin will have some logs, but nothing appeared. So then we tried to add below properties in application.properties
spring.zipkin.base-url=http://localhost:9411
spring.zipkin.enabled=true
spring.zipkin.service.name=xyz-service
spring.sleuth.enabled=true
spring.sleuth.integration.enabled=true
spring.sleuth.sampler.rate=100
spring.sleuth.sampler.probability=1.0
spring.zipkin.sender.type=web
And still dont see logs / service name in zipkin.
Can you see what am I doing wrong here. Out apps have cloud-stream dependencies as well. And also noted that in logs I am getting X-span-export coming as false. For ex: [3e205e41db60212f 77a405a53d62c9fa false]
Please upgrade the project to the latest version of Spring Boot and Spring Cloud. Also use the BOM as the source of versions - do not set them manually. Please do not set the default properties manually cause as defaults they are already set.

Passing configuration from yaml file to spring boot application without rebuilding it

How to pass configuration through yaml file to a running spring boot application so that there is no need of rebuilding the application and changes are reflected while the application is runnig?
I think this can help you:
How to hot-reload properties in Java EE and Spring Boot?
Take a look at Spring Boot Cloud Config. It allows you to manage your config files centralized and has the ability to push new configurations to the connected applications.

Can SpringBoot be use for Backend application?

One of the Spring framework advantage is dependency injection. Many had used SpringBoot for providing REST Web Services.
Read up and notice there are Scheduler and CommandLineRunner for SpringBoot, could we using SpringBoot for backend type of application to replace the usual standalone java program while making use of SpringBoot advantage (Dependency Injection)
- Cron Job (Execute and stop running)
- Long Running Process
One of the main thing I am looking into is to use annotation such as Spring Configuration, Spring Data JPA and other technology in backend application.
Of course!
I used spring boot to back CLI projects, DB access projects and more.
Spring boot is very modular. It works by providing auto-configuration based on your maven/gradle imports. If you don't import starter-web/starter-jersey or any other starter that is for the web/rest api, the auto-configuration for this resources won't be triggered and you can basically enjoy all the power of spring boot to support your needs
Definitely,
Spring boot is not a separate framework.It reduces the configuration difficulties when you using spring framework. Spring boot provides a Rapid Application Development using without complex configuration including your dispatcher servlet, XML file for database connectivity and configuration files. You can use spring boot for back-end development. Simply says you can do everything what you does in spring MVC without any complex configuration. If you are using spring boot , You can configure your database details in application.properties file. I am adding one of two links for proper reading,
https://projects.spring.io/spring-boot/ ,
https://dzone.com/articles/why-springboot

Spring Boot - logging configuration from JBoss

I'd like to know if there is a way to configure Spring Boot logging using JBoss standalone.xml or domain.xml configuration. For now I ended up with two empty files log4j.properties and log4j-file.properties under org\springframework\boot\logging\log4j package in mvn resources in WAR file and it looks like now my logging configuration in domain.xml works because I've overriden default spring-boot log4j configuration.
But there must be a better way to do this instead of this stupid hack. Keep in mind that I don't want to provide external log4j properties file and set it for one of the property in application.properties but I want to use jboss logging system configuration.
EDIT
Strange thing but when I updated Spring Boot to version 1.4.0 then JBoss intercepts the logs and log them only to the file and I don't have logs on the stdout anymore even without custom log4j configuration.

Logback Appender for Webpage in Spring Boot application

I have a maven and spring boot application which use logback.
This application is on some servers and the log files on this servers are stored only on this server.
Give it a tool/api which is free, can visualize the logs into a webpage and is easy to integrat with spring boot and maven?
I have try JAMon but it will not work with Spring boot (need to deploy a war file) because the spring boot application is a embedded application. Thanks for Help :)
Have a look on Kibana, search for ELK-Stack. You can easily run it using Docker. There is also a Maven lib for the logstash-forwarder.

Resources