BAEL-3222 Example Code and update to spring-boot-admin examples (#7804)
This commit is contained in:
parent
e093daf12d
commit
66f4d44c60
|
@ -30,7 +30,7 @@
|
|||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring.boot.version>1.5.8.RELEASE</spring.boot.version>
|
||||
<spring.boot.version>2.1.7.RELEASE</spring.boot.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -18,7 +18,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -59,7 +59,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<spring-boot-admin-starter-client.version>1.5.4</spring-boot-admin-starter-client.version>
|
||||
<spring-boot-admin-starter-client.version>2.1.6</spring-boot-admin-starter-client.version>
|
||||
<spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
#basic auth creddentials
|
||||
security.user.name=client
|
||||
security.user.password=client
|
||||
spring.security.user.name=client
|
||||
spring.security.user.password=client
|
||||
|
||||
#configs to connect to a secured server
|
||||
spring.boot.admin.url=http://localhost:8080
|
||||
spring.boot.admin.username=admin
|
||||
spring.boot.admin.password=admin
|
||||
spring.boot.admin.client.url=http://localhost:8080
|
||||
#spring.boot.admin.client.instance.service-base-url=http://localhost:8081
|
||||
spring.boot.admin.client.username=admin
|
||||
spring.boot.admin.client.password=admin
|
||||
|
||||
#configs to give secured server info
|
||||
spring.boot.admin.client.metadata.user.name=${security.user.name}
|
||||
spring.boot.admin.client.metadata.user.password=${security.user.password}
|
||||
spring.boot.admin.client.instance.metadata.user.name=${spring.security.user.name}
|
||||
spring.boot.admin.client.instance.metadata.user.password=${spring.security.user.password}
|
||||
|
||||
#app config
|
||||
spring.application.name=spring-boot-admin-client
|
||||
server.port=8081
|
||||
|
||||
management.endpoints.web.exposure.include=*
|
||||
management.endpoint.health.show-details=always
|
|
@ -18,18 +18,14 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- dependencies used to enable admin server and UI -->
|
||||
<!-- https://mvnrepository.com/artifact/de.codecentric/spring-boot-admin-starter-server -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server</artifactId>
|
||||
<version>${spring-boot-admin-server.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server-ui</artifactId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
<version>${spring-boot-admin-server.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -37,7 +33,7 @@
|
|||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-server-ui-login</artifactId>
|
||||
<version>${spring-boot-admin-server.version}</version>
|
||||
<version>${spring-boot-admin-server-ui-login.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -47,6 +43,7 @@
|
|||
<groupId>com.hazelcast</groupId>
|
||||
<artifactId>hazelcast</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--declare the admin server as a client, for self monitoring -->
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
|
@ -82,8 +79,9 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<spring-boot-admin-server.version>1.5.4</spring-boot-admin-server.version>
|
||||
<spring-boot-admin-starter-client.version>1.5.4</spring-boot-admin-starter-client.version>
|
||||
<spring-boot-admin-server.version>2.1.6</spring-boot-admin-server.version>
|
||||
<spring-boot-admin-starter-client.version>2.1.6</spring-boot-admin-starter-client.version>
|
||||
<spring-boot-admin-server-ui-login.version>1.5.7</spring-boot-admin-server-ui-login.version>
|
||||
<spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.baeldung.springbootadminserver;
|
||||
|
||||
import de.codecentric.boot.admin.config.EnableAdminServer;
|
||||
import de.codecentric.boot.admin.server.config.EnableAdminServer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
|
|
|
@ -2,8 +2,14 @@ package com.baeldung.springbootadminserver.configs;
|
|||
|
||||
import com.hazelcast.config.Config;
|
||||
import com.hazelcast.config.EvictionPolicy;
|
||||
import com.hazelcast.config.ListConfig;
|
||||
import com.hazelcast.config.InMemoryFormat;
|
||||
import com.hazelcast.config.MapConfig;
|
||||
import com.hazelcast.config.MergePolicyConfig;
|
||||
import com.hazelcast.config.TcpIpConfig;
|
||||
import com.hazelcast.map.merge.PutIfAbsentMapMergePolicy;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
@ -12,13 +18,30 @@ public class HazelcastConfig {
|
|||
|
||||
@Bean
|
||||
public Config hazelcast() {
|
||||
return new Config()
|
||||
.setProperty("hazelcast.jmx", "true")
|
||||
.addMapConfig(new MapConfig("spring-boot-admin-application-store")
|
||||
MapConfig eventStoreMap = new MapConfig("spring-boot-admin-event-store").setInMemoryFormat(InMemoryFormat.OBJECT)
|
||||
.setBackupCount(1)
|
||||
.setEvictionPolicy(EvictionPolicy.NONE))
|
||||
.addListConfig(new ListConfig("spring-boot-admin-event-store")
|
||||
.setEvictionPolicy(EvictionPolicy.NONE)
|
||||
.setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMapMergePolicy.class.getName(), 100));
|
||||
|
||||
MapConfig sentNotificationsMap = new MapConfig("spring-boot-admin-application-store").setInMemoryFormat(InMemoryFormat.OBJECT)
|
||||
.setBackupCount(1)
|
||||
.setMaxSize(1000));
|
||||
.setEvictionPolicy(EvictionPolicy.LRU)
|
||||
.setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMapMergePolicy.class.getName(), 100));
|
||||
|
||||
Config config = new Config();
|
||||
config.addMapConfig(eventStoreMap);
|
||||
config.addMapConfig(sentNotificationsMap);
|
||||
config.setProperty("hazelcast.jmx", "true");
|
||||
|
||||
config.getNetworkConfig()
|
||||
.getJoin()
|
||||
.getMulticastConfig()
|
||||
.setEnabled(false);
|
||||
TcpIpConfig tcpIpConfig = config.getNetworkConfig()
|
||||
.getJoin()
|
||||
.getTcpIpConfig();
|
||||
tcpIpConfig.setEnabled(true);
|
||||
tcpIpConfig.setMembers(Collections.singletonList("127.0.0.1"));
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,42 +1,40 @@
|
|||
package com.baeldung.springbootadminserver.configs;
|
||||
|
||||
import de.codecentric.boot.admin.notify.LoggingNotifier;
|
||||
import de.codecentric.boot.admin.notify.RemindingNotifier;
|
||||
import de.codecentric.boot.admin.notify.filter.FilteringNotifier;
|
||||
import java.time.Duration;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import de.codecentric.boot.admin.server.domain.entities.InstanceRepository;
|
||||
import de.codecentric.boot.admin.server.notify.LoggingNotifier;
|
||||
import de.codecentric.boot.admin.server.notify.RemindingNotifier;
|
||||
import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier;
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
public class NotifierConfiguration {
|
||||
@Autowired
|
||||
private InstanceRepository repository;
|
||||
|
||||
// @Autowired private Notifier notifier;
|
||||
// @Autowired private Notifier notifier;
|
||||
|
||||
@Bean
|
||||
public LoggingNotifier notifier() {
|
||||
return new LoggingNotifier();
|
||||
return new LoggingNotifier(repository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilteringNotifier filteringNotifier() {
|
||||
return new FilteringNotifier(notifier());
|
||||
return new FilteringNotifier(notifier(), repository);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
public RemindingNotifier remindingNotifier() {
|
||||
RemindingNotifier remindingNotifier = new RemindingNotifier(filteringNotifier());
|
||||
remindingNotifier.setReminderPeriod(TimeUnit.MINUTES.toMillis(5));
|
||||
RemindingNotifier remindingNotifier = new RemindingNotifier(filteringNotifier(), repository);
|
||||
remindingNotifier.setReminderPeriod(Duration.ofMinutes(5));
|
||||
remindingNotifier.setCheckReminderInverval(Duration.ofSeconds(60));
|
||||
return remindingNotifier;
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 60_000L)
|
||||
public void remind() {
|
||||
remindingNotifier().sendReminders();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,56 @@
|
|||
package com.baeldung.springbootadminserver.configs;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
|
||||
import de.codecentric.boot.admin.server.config.AdminServerProperties;
|
||||
|
||||
@Configuration
|
||||
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
private final AdminServerProperties adminServer;
|
||||
|
||||
public WebSecurityConfig(AdminServerProperties adminServer) {
|
||||
this.adminServer = adminServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.formLogin()
|
||||
.loginPage("/login.html")
|
||||
.loginProcessingUrl("/login")
|
||||
.permitAll();
|
||||
http
|
||||
.logout()
|
||||
.logoutUrl("/logout");
|
||||
http
|
||||
.csrf()
|
||||
.disable();
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/login.html", "/**/*.css", "/img/**", "/third-party/**")
|
||||
.permitAll();
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/**")
|
||||
.authenticated();
|
||||
http.httpBasic();
|
||||
SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
|
||||
successHandler.setTargetUrlParameter("redirectTo");
|
||||
successHandler.setDefaultTargetUrl(this.adminServer.getContextPath() + "/");
|
||||
|
||||
http.authorizeRequests()
|
||||
.antMatchers(this.adminServer.getContextPath() + "/assets/**")
|
||||
.permitAll()
|
||||
.antMatchers(this.adminServer.getContextPath() + "/login")
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.loginPage(this.adminServer.getContextPath() + "/login")
|
||||
.successHandler(successHandler)
|
||||
.and()
|
||||
.logout()
|
||||
.logoutUrl(this.adminServer.getContextPath() + "/logout")
|
||||
.and()
|
||||
.httpBasic()
|
||||
.and()
|
||||
.csrf()
|
||||
.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
|
||||
.ignoringRequestMatchers(new AntPathRequestMatcher(this.adminServer.getContextPath() + "/instances", HttpMethod.POST.toString()), new AntPathRequestMatcher(this.adminServer.getContextPath() + "/instances/*", HttpMethod.DELETE.toString()),
|
||||
new AntPathRequestMatcher(this.adminServer.getContextPath() + "/actuator/**"))
|
||||
.and()
|
||||
.rememberMe()
|
||||
.key(UUID.randomUUID()
|
||||
.toString())
|
||||
.tokenValiditySeconds(1209600);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
spring.application.name=spring-boot-admin-server
|
||||
|
||||
security.user.name=admin
|
||||
security.user.password=admin
|
||||
spring.security.user.name=admin
|
||||
spring.security.user.password=admin
|
||||
|
||||
#configs to connect to self register the admin server as a client
|
||||
spring.boot.admin.url=http://localhost:8080
|
||||
spring.boot.admin.username=${security.user.name}
|
||||
spring.boot.admin.password=${security.user.password}
|
||||
spring.boot.admin.client.url=http://localhost:8080
|
||||
spring.boot.admin.client.username=${spring.security.user.name}
|
||||
spring.boot.admin.client.password=${spring.security.user.password}
|
||||
|
||||
#configs to give secured server info
|
||||
spring.boot.admin.client.metadata.user.name=${security.user.name}
|
||||
spring.boot.admin.client.metadata.user.password=${security.user.password}
|
||||
spring.boot.admin.client.instance.metadata.user.name=${spring.security.user.name}
|
||||
spring.boot.admin.client.instance.metadata.user.password=${spring.security.user.password}
|
||||
|
||||
management.endpoints.web.exposure.include=*
|
||||
management.endpoint.health.show-details=always
|
||||
|
||||
#mail notifications
|
||||
#spring.mail.host=smtp.gmail.com
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.baeldung.springbootadminserver;
|
||||
|
||||
import com.baeldung.springbootadminserver.configs.NotifierConfiguration;
|
||||
import de.codecentric.boot.admin.notify.Notifier;
|
||||
import de.codecentric.boot.admin.notify.RemindingNotifier;
|
||||
import de.codecentric.boot.admin.notify.filter.FilteringNotifier;
|
||||
|
||||
import de.codecentric.boot.admin.server.notify.Notifier;
|
||||
import de.codecentric.boot.admin.server.notify.RemindingNotifier;
|
||||
import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -1,47 +1,56 @@
|
|||
<?xml version="1.0"?>
|
||||
<project
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>spring-boot-management</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-boot-management</name>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>spring-boot-management</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-boot-management</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<properties>
|
||||
<start-class>com.baeldung.spring.boot.management.logging.LoggingApplication</start-class>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-boot-admin-starter-client.version>2.1.6</spring-boot-admin-starter-client.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
||||
<version>${spring-boot-admin-starter-client.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.baeldung.spring.boot.management.logging;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class LoggingApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(LoggingApplication.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.baeldung.spring.boot.management.logging;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/log")
|
||||
public class LoggingController {
|
||||
private Log log = LogFactory.getLog(LoggingController.class);
|
||||
|
||||
@GetMapping
|
||||
public String log() {
|
||||
log.trace("This is a TRACE level message");
|
||||
log.debug("This is a DEBUG level message");
|
||||
log.info("This is an INFO level message");
|
||||
log.warn("This is a WARN level message");
|
||||
log.error("This is an ERROR level message");
|
||||
|
||||
return "See the log for details";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.baeldung.spring.boot.management.logging;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf()
|
||||
.ignoringAntMatchers("/actuator/**");
|
||||
}
|
||||
}
|
|
@ -1,3 +1,22 @@
|
|||
management.endpoints.web.exposure.include=httptrace
|
||||
management.endpoints.web.exposure.include=httptrace,loggers,health,info,metrics
|
||||
management.trace.http.include=RESPONSE_HEADERS
|
||||
management.endpoint.loggers.enabled=true
|
||||
|
||||
#basic auth creddentials
|
||||
spring.security.user.name=client
|
||||
spring.security.user.password=client
|
||||
|
||||
#configs to connect to a secured server
|
||||
spring.boot.admin.client.url=http://localhost:8080
|
||||
spring.boot.admin.client.username=admin
|
||||
spring.boot.admin.client.password=admin
|
||||
|
||||
#configs to give secured server info
|
||||
spring.boot.admin.client.instance.metadata.user.name=${spring.security.user.name}
|
||||
spring.boot.admin.client.instance.metadata.user.password=${spring.security.user.password}
|
||||
|
||||
#app config
|
||||
spring.application.name=spring-boot-management
|
||||
server.port=8081
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<configuration scan="true" scanPeriod="15 seconds">
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="com.baeldung.spring.boot.management.logging" level="INFO" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
Loading…
Reference in New Issue