refactor: change to MIT license and reformat codes
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
# Module `simple-jwt-spring-boot-starter`
|
||||
# JWT Toolbox :: Spring Boot Starter
|
||||
|
||||
## Introduction
|
||||
|
||||
Module `simple-jwt-spring-boot-starter` is a lightweight and easy-to-use Spring Boot starter module that provides seamless integration with JSON Web Token (JWT) authentication in Spring Boot applications. With this starter, developers can easily configure and enable JWT-based authentication for their APIs and web applications without the need for complex manual setup. It simplifies the process of generating and validating JWTs, making it effortless to secure endpoints and implement token-based authentication in Spring Boot projects. The module is designed to be flexible, allowing developers to customize various aspects of JWT authentication to suit their specific requirements. Overall, `simple-jwt-spring-boot-starter` is a convenient solution for adding secure and efficient JWT authentication to Spring Boot applications.
|
||||
Module **JWT Toolbox :: Spring Boot Starter** is a lightweight and easy-to-use Spring Boot starter
|
||||
module that provides seamless integration with JSON Web Token (JWT) authentication in Spring Boot
|
||||
applications. With this starter, developers can easily configure and enable JWT-based authentication
|
||||
for their APIs and web applications without the need for complex manual setup. It simplifies the
|
||||
process of generating and validating JWTs, making it effortless to secure endpoints and implement
|
||||
token-based authentication in Spring Boot projects. The module is designed to be flexible, allowing
|
||||
developers to customize various aspects of JWT authentication to suit their specific requirements.
|
||||
Overall, `jwt-toolbox-spring-boot-starter` is a convenient solution for adding secure and efficient JWT authentication to Spring Boot applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 OnixByte.
|
||||
* Copyright (c) 2024-2025 OnixByte
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import java.net.URI
|
||||
|
||||
plugins {
|
||||
@@ -99,8 +105,8 @@ publishing {
|
||||
}
|
||||
|
||||
scm {
|
||||
connection = "scm:git:git://github.com:OnixByte/JDevKit.git"
|
||||
developerConnection = "scm:git:git://github.com:OnixByte/JDevKit.git"
|
||||
connection = "scm:git:git://github.com:onixbyte/onixbyte-toolbox.git"
|
||||
developerConnection = "scm:git:git://github.com:onixbyte/onixbyte-toolbox.git"
|
||||
url = projectGithubUrl
|
||||
}
|
||||
|
||||
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 OnixByte.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.onixbyte.jwt.autoconfiguration;
|
||||
|
||||
import com.onixbyte.identitygenerator.IdentityGenerator;
|
||||
import com.onixbyte.jwt.TokenResolver;
|
||||
import com.onixbyte.jwt.auth0.AuthzeroTokenResolver;
|
||||
import com.onixbyte.jwt.autoconfiguration.properties.SimpleJwtProperties;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.onixbyte.jwt.constants.TokenAlgorithm;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* {@code AuthzeroTokenResolverAutoConfiguration} is responsible for automatically configuring the
|
||||
* Simple JWT library with
|
||||
* {@code com.auth0:java-jwt} when used in a Spring Boot application. It provides default settings
|
||||
* and configurations to ensure that the library works smoothly without requiring
|
||||
* manual configuration.
|
||||
* <p>
|
||||
* This autoconfiguration class sets up the necessary beans and components required for JWT
|
||||
* generation and validation. It automatically creates and configures the
|
||||
* {@link AuthzeroTokenResolver} bean based on the available options and properties.
|
||||
* <p>
|
||||
* Developers using the Simple JWT library with Spring Boot do not need to explicitly configure the
|
||||
* library, as the autoconfiguration takes care of setting up the necessary components and
|
||||
* configurations automatically. However, developers still have the flexibility to customise the
|
||||
* behavior of the library by providing their own configurations and properties.
|
||||
*
|
||||
* @author zihluwang
|
||||
* @version 1.6.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableConfigurationProperties(value = {SimpleJwtProperties.class})
|
||||
@ConditionalOnClass({DecodedJWT.class, AuthzeroTokenResolver.class})
|
||||
@ConditionalOnMissingBean({TokenResolver.class})
|
||||
@ConditionalOnBean(value = {IdentityGenerator.class}, name = "jtiCreator")
|
||||
@AutoConfigureAfter(value = GuidAutoConfiguration.class)
|
||||
public class AuthzeroTokenResolverAutoConfiguration {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(AuthzeroTokenResolverAutoConfiguration.class);
|
||||
|
||||
/**
|
||||
* Constructs a new {@code SimpleJwtAutoConfiguration} instance with the
|
||||
* provided SimpleJwtProperties.
|
||||
*
|
||||
* @param simpleJwtProperties a {@link SimpleJwtProperties} instance
|
||||
* @param jtiCreator a creator to create ids for JSON Web Token
|
||||
* @param objectMapper jackson JSON Handler
|
||||
*/
|
||||
@Autowired
|
||||
public AuthzeroTokenResolverAutoConfiguration(SimpleJwtProperties simpleJwtProperties,
|
||||
@Qualifier("jtiCreator") IdentityGenerator<?> jtiCreator,
|
||||
ObjectMapper objectMapper) {
|
||||
this.jtiCreator = jtiCreator;
|
||||
this.simpleJwtProperties = simpleJwtProperties;
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link TokenResolver} bean using {@link AuthzeroTokenResolver} if no existing
|
||||
* {@link TokenResolver} bean is found. The {@link AuthzeroTokenResolver} is configured with the
|
||||
* provided {@link IdentityGenerator}, {@code algorithm}, {@code issuer}, and {@code secret}
|
||||
* properties from {@link SimpleJwtProperties}.
|
||||
*
|
||||
* @return the {@link TokenResolver} instance
|
||||
*/
|
||||
@Bean
|
||||
public TokenResolver<DecodedJWT> tokenResolver() {
|
||||
var builder = AuthzeroTokenResolver.builder();
|
||||
|
||||
if (TokenAlgorithm.ECDSA_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
|
||||
builder.keyPair(simpleJwtProperties.getPublicKey(), simpleJwtProperties.getPrivateKey())
|
||||
.algorithm(simpleJwtProperties.getAlgorithm());
|
||||
} else if (TokenAlgorithm.HMAC_ALGORITHMS.contains(simpleJwtProperties.getAlgorithm())) {
|
||||
builder.secret(simpleJwtProperties.getSecret())
|
||||
.algorithm(simpleJwtProperties.getAlgorithm());
|
||||
}
|
||||
|
||||
builder.issuer(simpleJwtProperties.getIssuer());
|
||||
builder.jtiCreator(jtiCreator);
|
||||
builder.objectMapper(objectMapper);
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private final IdentityGenerator<?> jtiCreator;
|
||||
|
||||
private final SimpleJwtProperties simpleJwtProperties;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
}
|
||||
+16
-11
@@ -1,18 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 OnixByte.
|
||||
* Copyright (c) 2024-2025 OnixByte
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package com.onixbyte.jwt.autoconfiguration;
|
||||
|
||||
+18
-15
@@ -1,18 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 OnixByte.
|
||||
* Copyright (c) 2024-2025 OnixByte
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package com.onixbyte.jwt.autoconfiguration.conditions;
|
||||
@@ -29,14 +34,12 @@ import java.util.Objects;
|
||||
/**
|
||||
* The conditions to create bean {@code jtiCreator}.
|
||||
*
|
||||
* @author Zihlu Wang
|
||||
* @version 1.1.0
|
||||
* @author zihluwang
|
||||
* @version 3.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class GuidCreatorCondition implements Condition {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(GuidCreatorCondition.class);
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
|
||||
+23
-19
@@ -1,39 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2024-2025 OnixByte.
|
||||
* Copyright (c) 2024-2025 OnixByte
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package com.onixbyte.jwt.autoconfiguration.properties;
|
||||
|
||||
import com.onixbyte.jwt.SecretCreator;
|
||||
import com.onixbyte.jwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration;
|
||||
import com.onixbyte.jwt.constants.TokenAlgorithm;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* {@code SimpleJwtProperties} is a configuration properties class used to store the properties
|
||||
* {@code JwtProperties} is a configuration properties class used to store the properties
|
||||
* related to Simple JWT library configurations. These properties can be configured in the
|
||||
* application's properties file (e.g., application.properties) with the prefix
|
||||
* "onixbyte.simple-jwt".
|
||||
* <p>
|
||||
* {@code SimpleJwtProperties} provides configuration options for the JWT algorithm, issuer,
|
||||
* and secret. The properties are used by the {@link AuthzeroTokenResolverAutoConfiguration} to
|
||||
* {@code JwtProperties} provides configuration options for the JWT algorithm, issuer,
|
||||
* and secret. The properties are used by the {@code Auth0AutoConfiguration} to
|
||||
* set up the necessary configurations for JWT generation and validation.
|
||||
* <p>
|
||||
* Developers can customise the JWT algorithm, issuer, and secret by setting the corresponding
|
||||
* properties in the application's properties file. The {@code SimpleJwtAutoConfiguration} class
|
||||
* properties in the application's properties file. The {@code Auth0AutoConfiguration} class
|
||||
* reads these properties and uses them to create the TokenResolver bean with the
|
||||
* desired configuration.
|
||||
*
|
||||
@@ -41,13 +45,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @version 1.1.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "onixbyte.simple-jwt")
|
||||
public class SimpleJwtProperties {
|
||||
// @ConfigurationProperties(prefix = "onixbyte.jwt")
|
||||
public class JwtProperties {
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public SimpleJwtProperties() {
|
||||
public JwtProperties() {
|
||||
}
|
||||
|
||||
/**
|
||||
-1
@@ -1,2 +1 @@
|
||||
com.onixbyte.jwt.autoconfiguration.GuidAutoConfiguration
|
||||
com.onixbyte.jwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2024-2025 OnixByte.
|
||||
~ Copyright (c) 2024-2025 OnixByte
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
~ of this software and associated documentation files (the "Software"), to deal
|
||||
~ in the Software without restriction, including without limitation the rights
|
||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
~ copies of the Software, and to permit persons to whom the Software is
|
||||
~ furnished to do so, subject to the following conditions:
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~ The above copyright notice and this permission notice shall be included in all
|
||||
~ copies or substantial portions of the Software.
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
~ SOFTWARE.
|
||||
-->
|
||||
|
||||
<configuration>
|
||||
<property name="COLOURFUL_OUTPUT" value="%black(%date{'dd MMM, yyyy HH:mm:ss', Asia/Hong_Kong, en-UK}) %highlight(%-5level) %black(---) %black([%10.10t]) %cyan(%-20.20logger{20}) %black(:) %msg%n"/>
|
||||
<property name="STANDARD_OUTPUT" value="%date{'dd MMM, yyyy HH:mm:ss', Asia/Hong_Kong, en-UK} %-5level %black(---) [%10.10t] %-20.20logger{20} : %msg%n"/>
|
||||
<property name="COLOURFUL_OUTPUT"
|
||||
value="%black(%date{'dd MMM, yyyy HH:mm:ss', Asia/Hong_Kong, en-UK}) %highlight(%-5level) %black(---) %black([%10.10t]) %cyan(%-20.20logger{20}) %black(:) %msg%n"/>
|
||||
<property name="STANDARD_OUTPUT"
|
||||
value="%date{'dd MMM, yyyy HH:mm:ss', Asia/Hong_Kong, en-UK} %-5level %black(---) [%10.10t] %-20.20logger{20} : %msg%n"/>
|
||||
|
||||
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
|
||||
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>${COLOURFUL_OUTPUT}</pattern>
|
||||
@@ -29,4 +36,4 @@
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user