目录

LogConfig

Class Info

public class LogConfig

Log configuration class.

Public Constructor Summary

Constructor Name

LogConfig()

Builds a LogConfig instance.

LogConfig(String logPath)

Builds a LogConfig instance.

LogConfig(String logPath, int fileSize, int fileNum, int fileExpiredTime)

Builds a LogConfig instance.

Public Method Summary

Qualifier and Type

Method Name and Description

int

getFileExpiredTime()

Obtains the log file validity period, in days.

int

getFileNum()

Obtains the maximum number of saved log files.

int

getFileSize()

Obtains the size of a single log file, in MB.

String

getLogPath()

Obtains the path for storing log files.

void

setFileExpiredTime(int fileExpiredTime)

Sets the log file validity period, in days.

void

setFileNum(int fileNum)

Sets the maximum number of saved log files.

void

setFileSize(int fileSize)

Sets the size of a single log file, in MB.

void

setLogPath(String logPath)

Sets the path for storing log files.

Public Constructors

[h2]LogConfig

Constructor

public LogConfig()

Builds a LogConfig instance.

[h2]LogConfig(String logPath)

Constructor

public LogConfig(String logPath)

Builds a LogConfig instance.

Parameters

Name

Description

logPath

Path for storing log files.

[h2]LogConfig(String logPath, int fileSize, int fileNum, int fileExpiredTime)

Constructor

public LogConfig(String logPath, int fileSize, int fileNum, int fileExpiredTime)

Builds a LogConfig instance.

Parameters

Name

Description

logPath

Path for storing log files.

fileSize

Size of a single log file, in MB. The value ranges from 0 (exclusive) to 2. The default value is 2. If the entered value is not within the range, the default value will be used.

fileNum

Maximum number of saved log files. The value ranges from 0 (exclusive) to 20. The default value is 20. If the entered value is not within the range, the default value will be used.

fileExpiredTime

File validity period, in days. The value ranges from 0 (exclusive) to 5. The default value is 5. If the entered value is not within the range, the default value will be used.

Public Methods

[h2]getFileExpiredTime

Method

public int getFileExpiredTime()

Obtains the log validity period, in days.

Returns

Type

Description

int

Log file validity period.

[h2]getFileNum

Method

public int getFileNum()

Obtains the maximum number of saved log files.

Returns

Type

Description

int

Maximum number of saved log files.

[h2]getFileSize

Method

public int getFileSize()

Obtains the size of a single log file, in MB.

Returns

Type

Description

int

Size of a single log file.

[h2]getLogPath

Method

public String getLogPath()

Obtains the path for storing log files.

Returns

Type

Description

String

Path for storing log files.

[h2]setFileExpiredTime

Method

public void setFileExpiredTime(int fileExpiredTime)

Sets the log file validity period, in days.

Parameters

Name

Description

fileExpiredTime

Log file validity period, in days. The value ranges from 0 (exclusive) to 5. The default value is 5.

[h2]setFileNum

Method

public void setFileNum(int fileNum)

Sets the maximum number of saved log files.

Parameters

Name

Description

fileNum

Maximum number of saved log files. The value ranges from 0 (exclusive) to 20. The default value is 20.

[h2]setFileSize

Method

public void setFileSize(int fileSize)

Sets the size of a single log file, in MB.

Parameters

Name

Description

fileSize

Size of a single log file, in MB. The value ranges from 0 (exclusive) to 2. The default value is 2.

[h2]setLogPath

Method

public void setLogPath(String logPath)

Sets the path for storing log files.

Parameters

Name

Description

logPath

Path for storing log files.