The list of methods to do Log Message are organized into topic(s).
void
log(boolean console, boolean file) Configures the system log.
String filename = "log%g.txt";
int limit = 10000000;
int numLogFiles = 5;
if (file) {
FileHandler handler = new FileHandler(filename, limit, numLogFiles, true);
handler.setFormatter(new SimpleFormatter());
handler.setLevel(Level.ALL);
Logger.getLogger("").addHandler(handler);
...
void
log(final String file, final String msg) log
FileOutputStream out = null;
try {
out = new FileOutputStream(file, true);
out.write(msg.getBytes());
out.write("\n------------------------\n".getBytes());
} catch (IOException ess) {
} finally {
try {
...
void
log(final String message, final String file) Write in file - append.
FileWriter out = null;
try {
out = new FileWriter(file, true);
out.write(message);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (out != null) {
...