This page explains how to configure Logback connection settings to the physically connected directory in the Kubernetes environment.

The picture below shows the Logback settings:

In Apinizer,  TimeBasedRollingPolicy in the Logback library is used to write the data to the file.

The fields used for Logbackc onfiguration are shown in the table below.

Field

Description

Enabled

The active state of the connection.

Name

The name of the setting to be made.
DescriptionDescription can be entered.
Log PathIt is the directory information mounted on Kubernetes.
Log File NameIt is the information under which file name the logs will be kept.
Log Filename Pattern

It is the information in which format the file names of the logs will be.

  • When given as %d{yyyy-MM-dd}.%i.log, the filename is as follows:

ApinizerApiTraffic-<podname>-2023-12-09.0.log

  • When given as %d{yyyy-MM-dd-HH}.%i.log, the filename is as follows:

ApinizerApiTraffic-<podname>-2023-12-09-01.0.log

You can visit this page for detailed information.

TimeBasedRollingPolicy supports automatic file compression. This feature is enabled if the Log Filename Pattern value ends in .gz or .zip.

Log Pattern

It is the information in which format the log data will be written to the log files. In the default expression "%d{yyyy-MM-dd HH:mm:ss.SSS}[%m]%n", it is understood that time information will first be written in the specified format, then the data will be written in square brackets, and then the new line will be entered with the newLine character. .

You can visit this page for detailed information about formats.

Max File Size

It is the maximum size that a log file can reach in MB.

You can visit this page for detailed information.

Max History

If the "Retention" feature is active, it is the maximum number of files to be kept.

When "Log Filename Pattern" given as;

  • %d{yyyy-MM-dd}.%i.log, it means the maximum record to be kept in the daily.
  • %d{yyyy-MM-dd-HH}.%i.log, it means the maximum record to be kept hourly.

You can visit this page for detailed information.

Total Size Cap

If the "Retention" feature is active, it is the maximum file size to be retained in GB.

You can visit this page for detailed information.

Mounting Directory into Kubernetes

In the deployment file set as follows, the "Log Path" value in this connection configuration should be "/logs".

    volumeMounts:
    - mountPath: /logs -> Directory address inside the pod (if it doesn't exist, it will be created automatically)
      name: nfslog-volume
volumes:
- hostPath:
    path: /opt/logs -> Directory address on the server (directory must be writable and ready)
    type: Directory
  name: nfslog-volume