01: //severMiniLogFormatter.java
02: //-------------------------------------
03: //part of YACY
04: //(C) by Michael Peter Christen; mc@anomic.de
05: //first published on http://www.anomic.de
06: //Frankfurt, Germany, 2004
07: //
08: //This file ist contributed by Martin Thelian
09: //last major change: $LastChangedDate: 2005-09-05 08:01:54 +0000 (Mo, 05 Sep 2005) $ by $LastChangedBy: theli $
10: //Revision: $LastChangedRevision: 653 $
11: //
12: //This program is free software; you can redistribute it and/or modify
13: //it under the terms of the GNU General Public License as published by
14: //the Free Software Foundation; either version 2 of the License, or
15: //(at your option) any later version.
16: //
17: //This program is distributed in the hope that it will be useful,
18: //but WITHOUT ANY WARRANTY; without even the implied warranty of
19: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20: //GNU General Public License for more details.
21: //
22: //You should have received a copy of the GNU General Public License
23: //along with this program; if not, write to the Free Software
24: //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25: //
26: //Using this software in any meaning (reading, learning, copying, compiling,
27: //running) means that you agree that the Author(s) is (are) not responsible
28: //for cost, loss of data or any harm that may be caused directly or indirectly
29: //by usage of this softare or this documentation. The usage of this software
30: //is on your own risk. The installation and usage (starting/running) of this
31: //software may allow other people or application to access your computer and
32: //any attached devices and is highly dependent on the configuration of the
33: //software which must be done by the user of the software; the author(s) is
34: //(are) also not responsible for proper configuration and usage of the
35: //software, even if provoked by documentation provided together with
36: //the software.
37: //
38: //Any changes to this file according to the GPL as documented in the file
39: //gpl.txt aside this file in the shipment you received can be done to the
40: //lines that follows this copyright notice here, but changes must not be
41: //done inside the copyright notive above. A re-distribution must contain
42: //the intact and unchanged copyright notice.
43: //Contributions and changes to the program code must be marked as such.
44:
45: package de.anomic.server.logging;
46:
47: import java.util.logging.LogRecord;
48: import java.util.logging.SimpleFormatter;
49:
50: public final class serverMiniLogFormatter extends SimpleFormatter {
51:
52: private final StringBuffer buffer = new StringBuffer();
53:
54: public serverMiniLogFormatter() {
55: super ();
56: }
57:
58: public synchronized String format(LogRecord record) {
59:
60: StringBuffer buffer = this .buffer;
61: buffer.setLength(0);
62:
63: buffer.append(formatMessage(record));
64:
65: // adding the stack trace if available
66: buffer.append(System.getProperty("line.separator"));
67:
68: return buffer.toString();
69: }
70: }
|