728x90
반응형

 

개발단계 로그 출력 레벨 변경

application.properties 파일 내의

 

logging.level.org.springframework = debug

 

값으로 설정 변경한다.

 

 

 

변경전 기본 : INFO 레벨

2024-02-14T09:50:19.423+09:00  INFO 23884 --- [           main] k.p.s.thymeleaf.ThymeleafApplication     : Starting ThymeleafApplication using Java 17.0.9 with PID 23884 (D:\ProgramLang\thymeleaf\target\classes started by User in D:\ProgramLang\thymeleaf)
2024-02-14T09:50:19.426+09:00  INFO 23884 --- [           main] k.p.s.thymeleaf.ThymeleafApplication     : No active profile set, falling back to 1 default profile: "default"
2024-02-14T09:50:20.242+09:00  INFO 23884 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 (http)
2024-02-14T09:50:20.252+09:00  INFO 23884 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-02-14T09:50:20.252+09:00  INFO 23884 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.18]
2024-02-14T09:50:20.314+09:00  INFO 23884 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-02-14T09:50:20.315+09:00  INFO 23884 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 843 ms
2024-02-14T09:50:20.415+09:00  INFO 23884 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page: class path resource [static/index.html]
2024-02-14T09:50:20.641+09:00  INFO 23884 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) with context path ''
2024-02-14T09:50:20.649+09:00  INFO 23884 --- [           main] k.p.s.thymeleaf.ThymeleafApplication     : Started ThymeleafApplication in 1.544 seconds (process running for 1.921)

 

 

변경 후 : DEBUG 레벨

2024-02-14T09:52:39.114+09:00  INFO 3328 --- [           main] k.p.s.thymeleaf.ThymeleafApplication     : Starting ThymeleafApplication using Java 17.0.9 with PID 3328 (D:\ProgramLang\thymeleaf\target\classes started by User in D:\ProgramLang\thymeleaf)
2024-02-14T09:52:39.117+09:00  INFO 3328 --- [           main] k.p.s.thymeleaf.ThymeleafApplication     : No active profile set, falling back to 1 default profile: "default"
2024-02-14T09:52:39.118+09:00 DEBUG 3328 --- [           main] o.s.boot.SpringApplication               : Loading source class kr.pe.speech.thymeleaf.ThymeleafApplication
2024-02-14T09:52:39.163+09:00 DEBUG 3328 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@49c90a9c
2024-02-14T09:52:39.181+09:00 DEBUG 3328 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
2024-02-14T09:52:39.193+09:00 DEBUG 3328 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'
2024-02-14T09:52:39.642+09:00 DEBUG 3328 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'propertySourcesPlaceholderConfigurer'
2024-02-14T09:52:39.647+09:00 DEBUG 3328 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor'
2024-02-14T09:52:39.652+09:00 DEBUG 3328 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
2024-02-14T09:52:39.653+09:00 DEBUG 3328 --- [           mai

 

 

 

 

파일로 로그 정보를 출력하는 것은 별개임

728x90
반응형
728x90
반응형

UUID로 처리한 것이 '문자깨짐' 처리처럼 나타나서,

여러가지로 검증해 보았는데, 지극히 정상적임을 확인했다.

즉, 코드상에서 Query 등을 하면, 제대로 보이게 됩니다.

 

필자가 수행한 것은 id ( auto incremental key)를 UUID로 변경하였습니다.

@Data
@Table(name="user")
@Entity
@Getter
@Setter
@ToString
@AllArgsConstructor
@EqualsAndHashCode
public class User {

    /* Auto Incremental Key
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false, updatable = false)
    private Long id;
     */

    // UUID
    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name="uuid2", strategy = "uuid2")
    @Column(name="individual_user_id", columnDefinition = "BINARY(16)")
    private UUID id;
    
    
    

    @Column(nullable = false, unique = true)
    private String username;

    @Column(nullable = false)
    private String password;

    @Column(nullable = false)
    private String role;
    
}

 

 

Respository와 연결하고, Test 프로그램을 수행한 후, 

Heidi 프로그램을 통해 살표보니, 아래와 같이 해당 Field값이 문자의 깨짐과 같이 보입니다.

 

 

 

 

individual_user_id  열의 값들이 깨져 보이고, 전혀 UUID 같이 보여지지 않아, 당황하였고, 뭔가 내가 잘못하였나(charset등 )싶어 구글링해 보니.

   - 저장 공간을 아끼기 위해,

   - '-'를 빼고, HEX()처리하여  1byte글자처럼나타냈기

때문에 깨진 것 처럼 보인다고 합니다.

 

java 프로그램에서 select를 해서 출력해 보면, UUID값이 제대로 나타나고 활용할 수 있습니다.

 

System.out.println(  userRepository.findByUsername("lswbhm88@abc.com").get()  );

 

728x90
반응형

+ Recent posts