Java Doc for CommonLogger.java in  » Web-Server » Jigsaw » org » w3c » jigsaw » http » 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 » Web Server » Jigsaw » org.w3c.jigsaw.http 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.jigsaw.http.Logger
      org.w3c.jigsaw.http.CommonLogger

All known Subclasses:   org.w3c.jigsaw.http.ExtendedCommonLogger,
CommonLogger
public class CommonLogger extends Logger implements PropertyMonitoring(Code)
The CommonLogger class implements the abstract Logger class. The resulting log will conform to the common log format).
See Also:   org.w3c.jigsaw.http.Logger


Field Summary
final public static  StringBUFSIZE_P
     Name of the property indicating the buffer size for the logger. This buffer size applies only the the log file, not to the error log file, or the trace log file.
final public static  StringERRLOGNAME_P
     Name of the property indicating the error log file.
final public static  StringLOGDIRNAME_P
     Name of the property indicating the server trace file.
final public static  StringLOGNAME_P
     Name of the property indicating the log file.
final public static  StringROTATE_LEVEL_P
     Name of the property indicating the buffer size for the logger. This buffer size applies only the the log file, not to the error log file, or the trace log file.
final public static  StringTRACELOGNAME_P
     Name of the property indicating the server log directory.
protected  bytebuffer
    
protected  intbufptr
    
protected  intbufsize
    
protected  intday
    
protected  RandomAccessFileerrlog
    
protected  inthour
    
protected  RandomAccessFilelog
    
protected  intmonth
    
final protected static  Stringmonthnames
    
protected static  StringnoUrl
    
protected  ObservablePropertiesprops
    
protected  introtateLevel
    
protected  httpdserver
    
protected  RandomAccessFiletrace
    
protected  intyear
    

Constructor Summary
 CommonLogger()
     Construct a new Logger instance.

Method Summary
protected synchronized  voidappendLogBuffer(String msg)
    
protected synchronized  voidcheckLogFile(Date now)
    
protected synchronized  voiddateCache(long date, StringBuffer sb)
    
public  voiderrlog(Client client, String msg)
    
public  voiderrlog(String msg)
    
protected  voiderrlogmsg(String msg)
    
protected  StringgetFilename(String propname, String def)
     Get the name for the file indicated by the provided property. This method first looks for a property value.
public  voidinitialize(httpd server)
     Initialize this logger for the given server.
public  voidlog(Request request, Reply reply, int nbytes, long duration)
     Log the given HTTP transaction.
public  voidlog(String msg)
    
protected  voidlogmsg(String msg)
    
protected  voidopenErrorLogFile()
     Open this logger error log file.
protected  voidopenLogFile(int year, int month, int day)
    
protected  voidopenLogFile(int year, int month)
    
protected  voidopenLogFile(int year)
    
protected  voidopenLogFile()
     Open this logger log file.
protected  voidopenTraceFile()
     Open this logger trace file.
protected synchronized  voidoutput(RandomAccessFile f, String msg)
     Output the given message to the given RandomAccessFile. This method makes its best effort to avoid one byte writes (which you get when writing the string as a whole).
public  booleanpropertyChanged(String name)
     Property monitoring for the logger. The logger allows you to dynamically (typically through the property setter) change the names of the file to which it logs error, access and traces.
Parameters:
  name - The name of the property that has changed.
public synchronized  voidshutdown()
     Shutdown this logger.
public synchronized  voidsync()
     Save all pending data to stable storage.
public  voidtrace(Client client, String msg)
    
public  voidtrace(String msg)
    
protected  voidtracemsg(String msg)
    

Field Detail
BUFSIZE_P
final public static String BUFSIZE_P(Code)
Name of the property indicating the buffer size for the logger. This buffer size applies only the the log file, not to the error log file, or the trace log file. It can be set to zero if you want no buffering.

This property default to 4096.




ERRLOGNAME_P
final public static String ERRLOGNAME_P(Code)
Name of the property indicating the error log file. This property indicates the name of the error log file to use.

This property defaults to the errlog file in the server log directory.




LOGDIRNAME_P
final public static String LOGDIRNAME_P(Code)
Name of the property indicating the server trace file. This property indicates the name of the trace file to use.

This property defaults to the trace file in the server log directory.




LOGNAME_P
final public static String LOGNAME_P(Code)
Name of the property indicating the log file. This property indicates the name of the log file to use.

This property defaults to the log file in the server log directory.




ROTATE_LEVEL_P
final public static String ROTATE_LEVEL_P(Code)
Name of the property indicating the buffer size for the logger. This buffer size applies only the the log file, not to the error log file, or the trace log file. It can be set to zero if you want no buffering.

This property default to 4096.




TRACELOGNAME_P
final public static String TRACELOGNAME_P(Code)
Name of the property indicating the server log directory.

This property defaults to the logs directory in the server main directory.




buffer
protected byte buffer(Code)



bufptr
protected int bufptr(Code)



bufsize
protected int bufsize(Code)



day
protected int day(Code)



errlog
protected RandomAccessFile errlog(Code)



hour
protected int hour(Code)



log
protected RandomAccessFile log(Code)



month
protected int month(Code)



monthnames
final protected static String monthnames(Code)



noUrl
protected static String noUrl(Code)



props
protected ObservableProperties props(Code)



rotateLevel
protected int rotateLevel(Code)



server
protected httpd server(Code)



trace
protected RandomAccessFile trace(Code)



year
protected int year(Code)




Constructor Detail
CommonLogger
CommonLogger()(Code)
Construct a new Logger instance.




Method Detail
appendLogBuffer
protected synchronized void appendLogBuffer(String msg) throws IOException(Code)



checkLogFile
protected synchronized void checkLogFile(Date now)(Code)



dateCache
protected synchronized void dateCache(long date, StringBuffer sb)(Code)
It actually does multiple things, check when to rotate log files and also dumps the formatted date string to a stringbuffer it is dirty but hopefully faster than the previous version of the logger



errlog
public void errlog(Client client, String msg)(Code)



errlog
public void errlog(String msg)(Code)



errlogmsg
protected void errlogmsg(String msg)(Code)



getFilename
protected String getFilename(String propname, String def)(Code)
Get the name for the file indicated by the provided property. This method first looks for a property value. If none is found, it than constructs a default filename from the server root, by using the provided default name.

This method shall either succeed in getting a filename, or throw a runtime exception.
Parameters:
  propname - The name of the property.
Parameters:
  def - The default file name to use.
exception:
  HTTPRuntimeException - If no file name could be deduced fromthe provided set of properties.




initialize
public void initialize(httpd server)(Code)
Initialize this logger for the given server. This method gets the server properties describe above to initialize its various log files.
Parameters:
  server - The server to which thiss logger should initialize.



log
public void log(Request request, Reply reply, int nbytes, long duration)(Code)
Log the given HTTP transaction. This is shamelessly slow.



log
public void log(String msg)(Code)



logmsg
protected void logmsg(String msg)(Code)



openErrorLogFile
protected void openErrorLogFile()(Code)
Open this logger error log file.



openLogFile
protected void openLogFile(int year, int month, int day)(Code)



openLogFile
protected void openLogFile(int year, int month)(Code)



openLogFile
protected void openLogFile(int year)(Code)



openLogFile
protected void openLogFile()(Code)
Open this logger log file.



openTraceFile
protected void openTraceFile()(Code)
Open this logger trace file.



output
protected synchronized void output(RandomAccessFile f, String msg) throws IOException(Code)
Output the given message to the given RandomAccessFile. This method makes its best effort to avoid one byte writes (which you get when writing the string as a whole). It first copies the string bytes into a private byte array, and than, write them all at once.
Parameters:
  f - The RandomAccessFile to write to, which should be one oflog, errlog or trace.
Parameters:
  msg - The message to be written.
exception:
  IOException - If writing to the output failed.



propertyChanged
public boolean propertyChanged(String name)(Code)
Property monitoring for the logger. The logger allows you to dynamically (typically through the property setter) change the names of the file to which it logs error, access and traces.
Parameters:
  name - The name of the property that has changed. A boolean, true if the change was made, false otherwise.



shutdown
public synchronized void shutdown()(Code)
Shutdown this logger.



sync
public synchronized void sync()(Code)
Save all pending data to stable storage.



trace
public void trace(Client client, String msg)(Code)



trace
public void trace(String msg)(Code)



tracemsg
protected void tracemsg(String msg)(Code)



Methods inherited from org.w3c.jigsaw.http.Logger
abstract public void errlog(Client client, String msg)(Code)(Java Doc)
abstract public void errlog(String msg)(Code)(Java Doc)
abstract public void initialize(httpd server)(Code)(Java Doc)
abstract public void log(Request request, Reply reply, int nbytes, long duration)(Code)(Java Doc)
abstract public void log(String msg)(Code)(Java Doc)
abstract public void shutdown()(Code)(Java Doc)
abstract public void sync()(Code)(Java Doc)
abstract public void trace(Client client, String trace)(Code)(Java Doc)
abstract public void trace(String msg)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.