All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tkit.quarkus.log.json.LogJsonConfig Maven / Gradle / Ivy

There is a newer version: 2.32.0
Show newest version
/*
 * Copyright 2020 1000kit.org.
 *
 * 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 org.tkit.quarkus.log.json;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigDocFilename;
import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;

@ConfigDocFilename("tkit-quarkus-log-json.adoc")
@ConfigRoot(prefix = "tkit", phase = ConfigPhase.RUN_TIME, name = "log.json")
public class LogJsonConfig {

    /**
     * Empty list constant.
     */
    public static final String EMPTY_LIST = "";

    /**
     * Determine whether to enable the JSON console formatting extension, which disables "normal" console formatting.
     */
    @ConfigItem(name = "enabled", defaultValue = "true")
    boolean enabled;
    /**
     * Enable "pretty printing" of the JSON record. Note that some JSON parsers will fail to read pretty printed output.
     */
    @ConfigItem(name = "pretty-print", defaultValue = "false")
    boolean prettyPrint;
    /**
     * The date format to use. The special string "default" indicates that the default format should be used.
     */
    @ConfigItem(name = "date-format", defaultValue = "default")
    String dateFormat;
    /**
     * The special end-of-record delimiter to be used. By default, no delimiter is used.
     */
    @ConfigItem(name = "record-delimiter")
    Optional recordDelimiter;
    /**
     * The zone ID to use. The special string "default" indicates that the default zone should be used.
     */
    @ConfigItem(name = "zone-id", defaultValue = "default")
    String zoneId;
    /**
     * The exception output type to specify.
     */
    @ConfigItem(name = "exception-output-type", defaultValue = "formatted")
    ExtendedStructureFormatter.ExceptionOutputType exceptionOutputType;
    /**
     * Enable printing of more details in the log.
     * 

* Printing the details can be expensive as the values are retrieved from the caller. The details include the * source class name, source file name, source method name and source line number. */ @ConfigItem(name = "print-details", defaultValue = "false") boolean printDetails; /** * Add MDC keys mapping. */ @ConfigItem(name = "keys.mdc", defaultValue = EMPTY_LIST) List mdcKeys; /** * Add MDC prefix mapping. */ @ConfigItem(name = "keys.group", defaultValue = EMPTY_LIST) List mdcPrefixKeys; /** * Ignore keys. */ @ConfigItem(name = "keys.ignore", defaultValue = EMPTY_LIST) List ignoreKeys = new ArrayList<>(); /** * Override keys. */ @ConfigItem(name = "keys.override", defaultValue = EMPTY_LIST) List overrideKeys = new ArrayList<>(); /** * Override keys. */ @ConfigItem(name = "keys.type", defaultValue = EMPTY_LIST) List typeKeys = new ArrayList<>(); /** * Environment keys. */ @ConfigItem(name = "keys.env", defaultValue = EMPTY_LIST) List envKeys = new ArrayList<>(); /** * Number of characters after which the stacktrace is split. We produce linked messages. */ @ConfigItem(name = "split-stacktrace-after", defaultValue = "12000") Optional splitStacktraceAfter; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy