Source Code Cross Referenced for MonologLoggingManager.java in  » Search-Engine » snapper » org » enhydra » snapper » logging » 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 » Search Engine » snapper » org.enhydra.snapper.logging 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 2006.4.11
003:         *
004:         * TODO To change the template for this generated file go to
005:         * Window - Preferences - Java - Code Style - Code Templates
006:         */
007:        package org.enhydra.snapper.logging;
008:
009:        import java.util.Properties;
010:
011:        import org.enhydra.snapper.api.RootException;
012:
013:        import org.objectweb.util.monolog.Monolog;
014:        import org.objectweb.util.monolog.api.Logger;
015:        import org.objectweb.util.monolog.api.LoggerFactory;
016:        import org.objectweb.util.monolog.api.BasicLevel;
017:
018:        /**
019:         * Implementation of LoggingManager interface.
020:         */
021:        public class MonologLoggingManager implements 
022:                org.enhydra.snapper.api.logging.LoggingManager {
023:
024:            private String logerName;
025:            private Logger logger = null;
026:
027:            /**
028:             * Configures StandardLoggingManager.
029:             *
030:             * @param cus an instance of CallbackUtilities used to get
031:             *            properties for configuring logging in Shark.
032:             */
033:            public void configure(Properties prop) {
034:
035:                LoggerFactory lf = Monolog.getMonologFactory();
036:
037:                String name = prop.getProperty("LoggerName");
038:
039:                if (name != null)
040:                    logger = lf.getLogger(name);
041:                else
042:                    logger = lf.getLogger("Enhydra");
043:
044:            }
045:
046:            //////////////////////////////////////////////////////////////////
047:            //  LoggingManager API implementation
048:            //////////////////////////////////////////////////////////////////
049:
050:            /**
051:             * Log a message object with the <i>ERROR</i> Level.
052:             *
053:             * @param msg the message to log.
054:             *
055:             */
056:            public void error(String msg) {
057:                error(logerName, msg);
058:            }
059:
060:            /**
061:             * Log a message object with the <i>ERROR</i> Level.
062:             *
063:             * @param msg the message to log.
064:             * @param ex the exception to log, including its stack trace. 
065:             *
066:             */
067:            public void error(String msg, RootException ex) {
068:                error(logerName, msg, ex);
069:            }
070:
071:            /**
072:             * Log a message object with the <i>ERROR</i> Level.
073:             *
074:             * @param channel the log channel to be used for logging. 
075:             * @param msg the message to log.
076:             *
077:             */
078:            public void error(String channel, String msg) {
079:
080:                if (logger != null)
081:                    logger.log(BasicLevel.ERROR, msg);
082:
083:            }
084:
085:            /**
086:             * Log a message object with the <i>ERROR</i> Level.
087:             *
088:             * @param channel the log channel to be used for logging. 
089:             * @param msg the message to log.
090:             * @param ex the exception to log, including its stack trace. 
091:             *
092:             */
093:            public void error(String channel, String msg, RootException ex) {
094:
095:                if (logger != null)
096:                    logger.log(BasicLevel.ERROR, msg, ex);
097:
098:            }
099:
100:            /**
101:             * Log a message object with the <i>WARN</i> Level.
102:             *
103:             * @param msg the message to log.
104:             *
105:             */
106:            public void warn(String msg) {
107:                warn(logerName, msg);
108:            }
109:
110:            /**
111:             * Log a message object with the <i>WARN</i> Level.
112:             *
113:             * @param msg the message to log.
114:             * @param ex the exception to log, including its stack trace. 
115:             *
116:             */
117:            public void warn(String msg, RootException ex) {
118:                warn(logerName, msg, ex);
119:            }
120:
121:            /**
122:             * Log a message object with the <i>WARN</i> Level.
123:             *
124:             * @param channel the log channel to be used for logging. 
125:             * @param msg the message to log.
126:             *
127:             */
128:            public void warn(String channel, String msg) {
129:
130:                if (logger != null)
131:                    logger.log(BasicLevel.WARN, msg);
132:            }
133:
134:            /**
135:             * Log a message object with the <i>WARN</i> Level.
136:             *
137:             * @param channel the log channel to be used for logging. 
138:             * @param msg the message to log.
139:             * @param ex the exception to log, including its stack trace. 
140:             *
141:             */
142:            public void warn(String channel, String msg, RootException ex) {
143:                if (logger != null)
144:                    logger.log(BasicLevel.WARN, msg, ex);
145:
146:            }
147:
148:            /**
149:             * Log a message object with the <i>INFO</i> Level.
150:             *
151:             * @param msg the message to log.
152:             *
153:             */
154:            public void info(String msg) {
155:                info(logerName, msg);
156:            }
157:
158:            /**
159:             * Log a message object with the <i>INFO</i> Level.
160:             *
161:             * @param msg the message to log.
162:             * @param ex the exception to log, including its stack trace. 
163:             *
164:             */
165:            public void info(String msg, RootException ex) {
166:                info(logerName, msg, ex);
167:            }
168:
169:            /**
170:             * Log a message object with the <i>INFO</i> Level.
171:             *
172:             * @param channel the log channel to be used for logging. 
173:             * @param msg the message to log.
174:             *
175:             */
176:            public void info(String channel, String msg) {
177:                if (logger != null)
178:                    logger.log(BasicLevel.INFO, msg);
179:
180:            }
181:
182:            /**
183:             * Log a message object with the <i>INFO</i> Level.
184:             *
185:             * @param channel the log channel to be used for logging. 
186:             * @param msg the message to log.
187:             * @param ex the exception to log, including its stack trace. 
188:             *
189:             */
190:            public void info(String channel, String msg, RootException ex) {
191:                if (logger != null)
192:                    logger.log(BasicLevel.INFO, msg, ex);
193:
194:            }
195:
196:            /**
197:             * Log a message object with the <i>DEBUG</i> level.
198:             *
199:             * @param msg the message to log.
200:             *
201:             */
202:            public void debug(String msg) {
203:                debug(logerName, msg);
204:            }
205:
206:            /**
207:             * Log a message object with the <i>DEBUG</i> level.
208:             *
209:             * @param msg the message to log.
210:             * @param ex the exception to log, including its stack trace. 
211:             *
212:             */
213:            public void debug(String msg, RootException ex) {
214:                debug(logerName, msg, ex);
215:            }
216:
217:            /**
218:             * Log a message object with the <i>DEBUG</i> level.
219:             *
220:             * @param channel the log channel to be used for logging. 
221:             * @param msg the message to log.
222:             *
223:             */
224:            public void debug(String channel, String msg) {
225:                if (logger != null)
226:                    logger.log(BasicLevel.DEBUG, msg);
227:
228:            }
229:
230:            /**
231:             * Log a message object with the <i>DEBUG</i> level.
232:             *
233:             * @param channel the log channel to be used for logging. 
234:             * @param msg the message to log.
235:             * @param ex the exception to log, including its stack trace. 
236:             *
237:             */
238:            public void debug(String channel, String msg, RootException ex) {
239:                if (logger != null)
240:                    logger.log(BasicLevel.DEBUG, msg, ex);
241:
242:            }
243:
244:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.