Source Code Cross Referenced for LogConfig.java in  » J2EE » jag » com » finalist » util » log » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » jag » com.finalist.util.log 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*   Copyright (C) 2003 Finalist IT Group
002:         *
003:         *   This file is part of JAG - the Java J2EE Application Generator
004:         *
005:         *   JAG is free software; you can redistribute it and/or modify
006:         *   it under the terms of the GNU General Public License as published by
007:         *   the Free Software Foundation; either version 2 of the License, or
008:         *   (at your option) any later version.
009:         *   JAG is distributed in the hope that it will be useful,
010:         *   but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:         *   GNU General Public License for more details.
013:         *   You should have received a copy of the GNU General Public License
014:         *   along with JAG; if not, write to the Free Software
015:         *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
016:         */
017:
018:        package com.finalist.util.log;
019:
020:        /**
021:         * Value object with log settings
022:         * @author Ronald Kramp - Finalist IT Group
023:         * @version $Revision: 1.1 $, $Date: 2004/11/12 14:06:44 $
024:         */
025:        public class LogConfig {
026:
027:            /** the logfile to log to */
028:            private String logFile = "finalist%g.log";
029:
030:            /** append to the logfile */
031:            private boolean append = true;
032:
033:            /** maximum number of logfiles to create */
034:            private int maxBackupIndex = 1;
035:
036:            /** maxfilesize for each created logfile */
037:            private int maxFileSize = 50;
038:
039:            /** the number of packages to show for a class */
040:            private int showNumberOfLastPackages = 0;
041:
042:            /** the datepattern to log */
043:            private String datePattern = "yyyy-MM-dd HH:mm:ss,SSS";
044:
045:            /** the messagespearator */
046:            private String messageSeparator = "-";
047:
048:            /** the loglevel for logging certain messages */
049:            private String logLevel = "INFO";
050:
051:            /**
052:             * Constrcutor for making a LogConfig
053:             * All settings for a appender
054:             * @param logFile the name of the logfile, default finalist%g.log
055:             * @param append default true
056:             * @param maxBackupIndex the number of files to create, must be greater than 0, default 1
057:             * @param maxFileSize the size of a log file in megabytes, must be greater than 0, default 50
058:             * @param showNumberOfLastPackages the number of pacakges of a class to show, cannot be negative, default 0
059:             * @param datePattern the date to log, default yyyy-MM-dd HH:mm:ss,SSS
060:             * @param messageSeparator default -
061:             * @param logLevel default INFO
062:             */
063:            public LogConfig(String logFile, boolean append,
064:                    int maxBackupIndex, int maxFileSize,
065:                    int showNumberOfLastPackages, String datePattern,
066:                    String messageSeparator, String logLevel) {
067:                if ((logFile != null) && (!logFile.equals(""))) {
068:                    this .logFile = logFile;
069:                }
070:                this .append = append;
071:                if (maxBackupIndex > 0) {
072:                    this .maxBackupIndex = maxBackupIndex;
073:                }
074:                if (maxFileSize > 0) {
075:                    this .maxFileSize = maxFileSize;
076:                }
077:                if (showNumberOfLastPackages > -1) {
078:                    this .showNumberOfLastPackages = showNumberOfLastPackages;
079:                }
080:                if ((datePattern != null) && (!datePattern.equals(""))) {
081:                    this .datePattern = datePattern;
082:                }
083:                if ((messageSeparator != null)
084:                        && (!messageSeparator.equals(""))) {
085:                    this .messageSeparator = messageSeparator;
086:                }
087:                if ((logLevel != null) && (!logLevel.equals(""))) {
088:                    this .logLevel = logLevel;
089:                }
090:            }
091:
092:            /**
093:             * Get the name of the logfile
094:             * @return String, the name of the log file
095:             */
096:            public String getLogFile() {
097:                return this .logFile;
098:            }
099:
100:            /**
101:             * Check to see if the logfile is appendable
102:             * @return boolean, logfile is appendable
103:             */
104:            public boolean isAppendable() {
105:                return this .append;
106:            }
107:
108:            /**
109:             * Get the maxBackupIndex
110:             * @return int, the maxBackupIndex
111:             */
112:            public int getMaxBackupIndex() {
113:                return this .maxBackupIndex;
114:            }
115:
116:            /**
117:             * Get the maxFileSize
118:             * @return int, maxFileSize
119:             */
120:            public int getMaxFileSize() {
121:                return this .maxFileSize;
122:            }
123:
124:            /**
125:             * Get the showNumberOfLastPackages
126:             * @return int, the showNumberOfLastPackages
127:             */
128:            public int getShowNumberOfLastPackages() {
129:                return this .showNumberOfLastPackages;
130:            }
131:
132:            /**
133:             * Get the datePattern
134:             * @return String, the datePattern
135:             */
136:            public String getDatePattern() {
137:                return this .datePattern;
138:            }
139:
140:            /**
141:             * Get the messageSeparator
142:             * @return String, the messageSeparator
143:             */
144:            public String getMessageSeparator() {
145:                return this .messageSeparator;
146:            }
147:
148:            /**
149:             * Get the logLevel
150:             * @return String, the logLevel
151:             */
152:            public String getLogLevel() {
153:                return this .logLevel;
154:            }
155:
156:            /**
157:             * returning the string with all values
158:             * @return String, all values as a String
159:             */
160:            public String toString() {
161:                return "[logFile=" + this .logFile + "]" + ", [append="
162:                        + this .append + "]" + ", [maxBackupIndex="
163:                        + this .maxBackupIndex + "]" + ", [maxFileSize="
164:                        + this .maxFileSize + "]"
165:                        + ", [showNumberOfLastPackages="
166:                        + this .showNumberOfLastPackages + "]"
167:                        + ", [datePattern=" + this .datePattern + "]"
168:                        + ", [messageSeparator=" + this .messageSeparator + "]"
169:                        + ", [logLevel=" + this .logLevel + "]";
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.