package com.prochera.work.projects.md.das.logger;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
public class DataAggregationServiceLogger {
static private FileHandler fileTxt;
static private SimpleFormatter formatterTxt;
static private FileHandler fileHTML;
static private Formatter formatterHTML;
static public void setup(String p_logDir) throws IOException {
// Create Logger
Logger logger = Logger.getLogger("");
logger.setLevel(Level.ALL);
fileTxt = new FileHandler(p_logDir+"/DAS_"+now("dd.MM.yyyy_H.mm.ss")+".txt");
fileHTML = new FileHandler(p_logDir+"/DAS_"+now("dd.MM.yyyy_H.mm.ss")+".html");
// Create txt Formatter
formatterTxt = new SimpleFormatter();
fileTxt.setFormatter(formatterTxt);
logger.addHandler(fileTxt);
// Create HTML Formatter
formatterHTML = new DataAggregationServiceHtmlFormatter();
fileHTML.setFormatter(formatterHTML);
logger.addHandler(fileHTML);
}
public static String now(String dateFormat) {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
return sdf.format(cal.getTime());
}
}
Code test
Shopping day
By last month there was to much python.. so today i bought two new books about JEE
First one is about design patterns, practices and metodologies in J2EE based applications development, second one is about very useful tool for development web and JEE applications, witch is a plugin for my favorite IDE Eclipse.
I have just started reading Eclipse Web Tools Platform, so soon i will write a review of this book.
Hello world!
Hi my name is Marek Prochera, I’m 24 years old software developer & creative graphic designer currently living in Cracow, Poland.
I’ve started a blog and basically this situation could be describe by following picture.
By the way I will try to write something about my experience with software developing or computer science so you will be able to find some trick & tips or kinds of tutorials.
I have strong motivation to publish everyday something new, but I can’t promise that it will happen.
Now I’m working on my master’sĀ thesis, so by next 3 month I will write a lot about technologies witch I use in my master degreeĀ project, that consists python programming language and django web framework .
see you later aligator