이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 4. Configuring JSON logging format


You can change the output format of the console log to JSON to make it easier to process and store the log information for later analysis.

To configure the JSON logging format, you need to add the quarkus-logging-json extension to your Quarkus project. The quarkus-logging-json extension replaces the output format configuration from the console configuration. The console configuration items such as the format string and the color settings will be ignored. Other console configuration items, including those controlling asynchronous logging and the logging level, continue to be applied.

Procedure

  1. Add the quarkus-logging-json extension to the pom.xml file of your application:

    pom.xml

      <dependencies>
        <!-- ... your other dependencies are here ... -->
        <dependency>
          <groupId>io.quarkus</groupId>
          <artifactId>quarkus-logging-json</artifactId>
        </dependency>
      </dependencies>
    Copy to Clipboard Toggle word wrap

  2. (Optional) Set a profile-specific configuration for JSON logging in your application.properties file:

    src/main/resources/application.properties

    %<profile>.<configuration_key>=<value>
    Copy to Clipboard Toggle word wrap

    The following example shows how you can disable JSON logging for the development and test profiles:

    src/main/resources/application.properties

    %dev.quarkus.log.console.json=false
    %test.quarkus.log.console.json=false
    Copy to Clipboard Toggle word wrap

4.1. JSON logging configuration properties

You can configure the JSON logging extension with the following configuration properties:

Expand
Table 4.1. JSON configuration properties
Configuration propertyDescriptionTypeDefault

quarkus.log.console.json

Enable the JSON console formatting extension.

boolean

true

quarkus.log.console.json.pretty-print

Enable pretty printing of the JSON record. [a]

boolean

false

quarkus.log.console.json.date-format

The format for dates. The default string sets the default format to be used.

string

default

quarkus.log.console.json.record-delimiter

Special end-of-record delimiter. By default, newline is used as delimiter.

string

 

quarkus.log.console.json.zone-id

The ID for zone. The default string sets the default zone to be used.

string

default

quarkus.log.console.json.exception-output-type

The output type for exception.

detailed, formatted, detailed-and-formatted

detailed

quarkus.log.console.json.print-details

Enable detailed printing of the logs. The details include the source class name, source file name, source method name, and source line number. [b]

boolean

false

[a] Some processors and JSON parsers might fail to read pretty printed output.
[b] Printing the details can be expensive as the values are retrieved from the caller.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat