I used the default Where datestore is the class name. But I'm unable to store logs. I am running on a Windows 7 machine and part of the above programmable servlet. I apologize for the seemingly stupid question, but sometimes such weaker things hinder a lot of progress. By default, Read this for further reference. java.util.logging to print the information on my logs. I am
logger.getlogger (Datastore.class.getName ()); Logger.info ("Registration");
java.util.logging.Logger sends output to the console And is not printed in any file. You have to add a
java.util.logging.Handler logger. Below are snippets for creating HTML handlers, TEXTFILE. Hope it helps.
Package logging; Import java.io.IOException; 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 MyLogger {Fixed Private FileHandler fileTxt; Static Personal Sensor Formatter Format; Fixed private filehanger file HTML; Fixed personal format format HTML; Fixed public zero setup () throws IOException {// Logger Logger Logger = Logger Tag (""); Logger.setLevel (Level.INFO); FileTxt = new file handler ("logging .txt"); File html = new file handler ("logging_light"); // T.T.T. Formatter Format Curtain = Create New Simple Former; FileTxt.setFormatter (formatterTxt); Logger.addHandler (fileTxt); // Create html format format HTML = new MyHtmlFormatter (); FileHTML.setFormatter (formatterHTML); Logger.addHandler (fileHTML); }}
Comments
Post a Comment