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("test.log", "This is info");
		} 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("test.log", "This is warning");
		} 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("test.log", "This is error");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}