FileLogger

Utility methods to generate a log. For example, to show error, info or warning. 

Methods

info

Description:

MethodReturn valuesDescription

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

void

Static file logger with info.

baseName: The name of file to write.

message: A text with 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");
            FileLogger.info("logName", "Parameters: %s %s", "one", "two");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

warn

Description:

MethodReturn valuesDescription

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

void

Static file logger with warn.

baseName: The name of file to write.

message: A text with 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");
            FileLogger.warn("logName", "Parameters: %s %s", "one", "two");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

error

Description:

MethodReturn valuesDescription

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

void

Static file logger with error.

baseName: The name of file to write.

message: A text with 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");
            FileLogger.error("logName", "Parameters: %s %s", "one", "two");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
Table of contents [ Hide Show ]