FileLogger

Utility methods to generate logs. For example, to show error, info, or warning messages. 

Methods

info

Description:

MethodReturn valuesDescription

info(String baseName, String message, Object... params)

void

Static file logger for informational messages.

baseName: The name of the file to write.

message: A text message for info.

Example:

package com.openkm;

import com.openkm.util.FileLogger;

public class Test {

    public static void main(String[] args) {
        try {
            FileLogger.info("logName", "This is info");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

warn

Description:

MethodReturn valuesDescription

warn(String baseName, String message, Object... params)

void

Static file logger for warning messages.

baseName: The name of the file to write.

message: A text message for warning.

Example:

package com.openkm;

import com.openkm.util.FileLogger;

public class Test {

    public static void main(String[] args) {
        try {
            FileLogger.warn("logName", "This is warning");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

error

Description:

MethodReturn valuesDescription

error(String baseName, String message, Object... params)

void

Static file logger for error messages.

baseName: The name of the file to write.

message: A text message for error.

Example:

package com.openkm;

import com.openkm.util.FileLogger;

public class Test {

    public static void main(String[] args) {
        try {
            FileLogger.error("logName", "This is error");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Table of contents [ Hide Show ]