Home
Logging Collector 3.0 User Guide
Contents
1. param b return the sum I public int sum int a int b log debug First number a log debug Second number b return a b public static void main String args Example example new Example example sum 5 6 Logging Collector Date 10 11 2005 Page 36 of 38 Logging Collector Date 10 11 2005 16 Appendix D Some useful web application parameters of the Logging Collector The Logging Collector has got the TOMCAT HOME webapps Collector WEB INF web xml web application configuration file In this file there are some parameters you can change The parameters are written in the following format init param lt param name gt ParameterName lt param name gt lt param value gt Parameter Value lt param value gt lt init param gt Parameter 7 et Value Available Parameter Values PingCommandEnabled _ YES NO TEES Description YES To enable the ping check if you are using the SocketAppender NO To disable the ping check if you are using the SocketAppender Table 16 1 PingCommandEnabled web application parameters of the Logging Collector Parameter Default Value Available Parameter Values StateStartMode CONFIGURE CONFIGURE START Parameter Description START if you want to start the Logging Collector at the Tomcat startup time CONFIGURE if you want to start the Logging Collector by the Command web page Table 16 2 StateStartMode web application paramete
2. Chainsaw v2 Log Viewer Fle view Current tab Help i a ja S Mew org apache log4 net JMSHeceiver NEUE Be em x function asd parent document tile TMSRecever Logd Version 1 3alpha 3 Overview Package Class Use Tree Deprecated Index Help Logdj L3alpha 3 dci PNE SUMMARY NESTED FIELD CONTE METHOD DETAIL FIELD COHETE METHOD org apache logdj net Class JMSReceiver java lang Object org apache log4 plugins PluginSkeleton org apache dogi plugins Receiver ct 0rq apache loq4 net JMSReceiver LL iu gt t wae Le JL ie Joss J Figure 11 3 Chainsaw how to create a JMSReceiver e ClientJMS They must be able to receive logging information from JMS so their configuration file collectorClient scripts configFiles ClientJMSCollector config is initial_context_factory com sun jndi ldap LdapCtxFactory provider_url Idap host04 389 o IMQ dc infn dc it topicConnectionFactory cn tcf topicName cn mt Page 27 of 38 Logging Collector Date 10 11 2005 12 Frequently asked questions 1 When I press a button in the command web page nothing happens Check the browser settings The javascript is enabled You should enable the javascript in the browser you are using 2 In the collected logging information isn t displayed the location information Have you set the LocationInfo property The LocationI
3. Laboratori Nazionali di Legnaro Grid Enabled Remote Instrumentation with Distributed Control and Computation Logging Collector 3 0 User Guide Version 1 0 10 11 2005 Version 1 0 Date 10 11 2005 Authors E Frizziero Cl identifier Information Society Infrastructures Logging Collector Date 10 11 2005 Revision History Page 2 of 38 Logging Collector Date 10 11 2005 Cl Record Field Description Cl Identifier Description Submission Date Submitted By Components Dependencies Related External Identifier Point of Contact Comments Physical Location Page 3 of 38 Table of Contents Overview Logging Collector architecture 2 1 Input section 2 2 Output section 2 2 1 SocketAppender 2 2 2 JMSAppender 2 2 3 DBAppender 2 3 Command interface section 2 3 1 Commands Logging Collector core 3 1 Logging Collector state machine 3 2 Logging Collector working commands da Description of the transitions Logging Collector Appender core 4 1 Appender state machine 4 2 Logging Collector Appender commands 4 3 Description of the transitions 4 4 Appender working modes 4 4 1 NO QUEUE working mode 4 4 2 QUEUE WITH LOST MSG working mode 4 4 3 QUEUE WITH NO LOST MSG working mode 4 4 4 Example Logging Collector web surfing Logging Collector command interface 6 1 Command web page 6 1 1 Logging Collector working commands 6 1 2 Refresh button and Message from Collector 6 1 3 Logging Collector Appen
4. 0 2 Notes Ta switch in position 2 Td switch in position 4 Tc switch in position 10 Table 14 1 NO QUEUE mode From OFF to STANDBY transition Path STANDBY to ON ON Dela Notes Ta switch in position 1 Td switch in position 4 Tc switch in position 9 Table 14 2 NO_QUEUE mode From STANDBY to ON transition Path ON to STANDBY STANDBY 0 Ted 10 Notes Ta switch in position 1 Td switch in position 4 Tc switch in position 10 Table 14 3 NO_QUEUE mode From ON to STANDBY transition Path ON to OFF pe j Notes The appender is destroyed Table 14 4 NO_QUEUE mode From ON to OFF transition Page 32 of 38 Logging Collector Date 10 11 2005 14 2 2 QUEUE_WITH_LOST_MSG working mode Path OFF to STANDBY STANDBY s 0 2 Notes Ta switch in position 2 Tb switch open Td switch in position 3 Te switch in position 5 Table 14 5 QUEUE WITH LOST MSG mode From OFF to STANDBY transition Path STANDBY to ON ON Appender queue 0 1 3 5 8 11 isn t full Notes Ta switch in position 1 Tb switch close Td switch in position 3 Te switch in position 5 Table 14 6 QUEUE_WITH_LOST_MSG mode From STANDBY to ON transition Path STANDBY to ON Appender queue 0 1 3 6 is full Notes Ta switch in position 1 Tb switch close Td switch in position 3 Te switch in position 6 Table 14 7 QUEUE_WITH_LOST_MSG mode From STANDBY to ON transition Path ON to ST
5. i e it is tempting to connect to its output client ON Appender is active 1 e it can send the logging information to its output client Table 4 1 Appender states Output appender clients are for example e A Chainsaw for the socket appender e Adatabase for the DB appender e A JMS for the JMS appender 4 2 Logging Collector Appender commands Each Logging Collector appender can accept the following commands e Add The Add appender command allows to enable an appender of the Logging Collector e Remove The Remove appender command allows to remove an appender of the Logging Collector e ViewMessage The ViewMessage appender command allows to display a possible message from the appender Page 11 of 38 Logging Collector Date 10 11 2005 4 3 Description of the transitions From State To State STANDBY After this transition the appender is enabled Table 4 2 From OFF to STANDBY transition STANDBY ONT O In the STANDBY state an appender is enabled but is not active because it still must open a connection to its output client For the SocketAppender it means that it is tempting to create a connection to the host on the port number specified in its configuration Once the connection has been opened the appender with a spontaneous transition enters the ON state and becomes active Table 4 3 From STANDBY to ON transition To State ON STANDBY Te Fd Jgo90 0Q If the appender during its fu
6. logging information and if necessary filter it by defining filter conditions at the subscription time By the way two types of JMS s subscribers have been implemented and are available in the Logging Collector release clientCollector zip package 1 clientJMSAppender a generic subscriber receiving the whole logging information 2 clientSelectorJMSAppender a selector subscriber which filters the logging information according to the particular level specified Gf message selectors are enabled in the JMSAppender configuration 2 2 5 DBAppender The DBAppender can be used to store the collected logging information to a database in order to ensure the persistent storage and so build an historical archive The connection database is made via JDBC 2 3 Command interface section The command interface section allows to send commands to the Logging Collector The Logging Collector can receive commands both by a command web service and by a command web page For more details see the next paragraphs 2 3 1 Commands Commands are of two types e Commands for the Logging Collector functioning Start Stop Configure Monitor e Commands for Logging Collector appenders Add Remove View Message Page 8 of 38 Logging Collector Date 10 11 2005 3 Logging Collector core 3 1 Logging Collector state machine The Logging Collector has got an internal state machine whose transitions are determined by the current state and
7. output section e acommand interface section TCP JMS Appender Java u TE Receiver O DB Appender TCP XML Receiver gt Interface C C 2 TCP Socket Appender others Figure 2 1 Logging Collector architecture 2 1 Input section The Logging Collector provides two TCP inputs The former receives java log4j LoggingEvent objects org apache log4 spi LoggingEvent from java applications The latter instead more generic can receive logging information in XML format log4j compliant from non java applications such as C or C applications 2 2 Output section The outputs of the logging collector called appenders are e Socket Appender e JMS Appender e DB Appender The collector s outputs are used to allow the persistent storage the display and the distribution of the logging information 2 2 1 SocketAppender The SocketAppender allows to send the logging information to a TCP port Page of 38 Logging Collector Date 10 11 2005 The SocketAppender correctly configured can be used for example to send the logging information to Chaisaw Chaisaw site to display it in real time Otherwise it can be used to send the collected logging information to another Logging Collector instance to build a possible hierarchic structure of collectors 2 2 2 JMSAppender The JMSAppender can be used to send the logging information to a message system JMS In this way JMS s subscribers can receive the real time
8. 9 2 Non Java application A non java application can send the logging information by opening a TCP socket to the TCP XML input of the Logging Collector The Logging information must be in XML format log4j compliant Example lt log4j event logger ProductLog timestamp 181256984 level WARN thread 10241 gt lt log4j message gt The store pipe is broken lt log4j message gt lt log4j NDC gt 192 165 12 128 lt log4j NDC gt lt log4j throwable gt lt log4j throwable gt lt log4j locationInfo class ProductLog method insertPipe file Productlog cc line 134 gt lt log4j event gt It must be used the NDC object org apache log4j NDC to set the necessary information to identify unambiguously the logging information origin Page 22 of 38 gt Logging Collector Date 10 11 2005 LocationInfo property must be set to true value to include the location information method class line information in the logging information too In some case it 1s necessary to set the ReconnectionDelay property Default values 30 seconds Page 23 of 38 Logging Collector Date 10 11 2005 10 How to display collected logging information i For a graphical display of the collected logging information a log4j application called 4 Chainsaw is available Chainsaw can be download from url http logging apache org log4j docs chainsaw html Chainsaw has many functionalities for example it can filter the recei
9. ANDBY STANDBY Appender queue 0 1 3 5 isn t full Notes Ta switch in position 1 Tb switch open Td switch in position 3 Te switch in position 5 The logging information is left into the appender queue Table 14 8 QUEUE_WITH_LOST_MSG mode From ON to STANDBY transition Page 33 of 38 Logging Collector Date 10 11 2005 Path ON to STANDBY STANDBY Appender queue 0 1 3 6 is full Notes Ta switch in position 1 Tb switch open Td switch in position 3 Te switch in position 6 Table 14 9 QUEUE_WITH_LOST_MSG mode From ON to STANDBY transition Path ON to OFF OFF Notes The appender is destroyed Table 14 10 QUEUE WITH LOST MSG mode From ON to OFF transition 14 2 5 QUEUE WITH NO LOST MSG working mode Path OFF to STANDBY STANDBY 0 2 Notes Ta switch in position 2 Tb switch open Td switch in position 3 Te switch in position 5 Table 14 11 QUEUE WITH NO LOST MSG mode From OFF to STANDBY transition Path STANDBY to ON ON 0 1 3 5 7 8 11 Notes Ta switch in position 1 Tb switch close Td switch in position 3 Te switch in position 5 The appender input client slows down if the appender queue becomes full Table 14 12 QUEUE WITH NO LOST MSG mode From STANDBY to ON transition Page 34 of 38 Logging Collector Date 10 11 2005 Path ON to STANDBY STANDBY 0 1 3 5 Notes Ta switch in position 1 Tb switch open Td switch in position 3 Te s
10. Logging Collector Date 10 11 2005 By pressing the Save amp Load Configuration button you can save in a permanent way the modifications to the configuration see Appendix A and load the updated configuration into the Logging Collector The new configuration becomes the actual Logging Collector configuration When a new Logging Collector configuration is loaded the Logging Collector appenders belonging to the previous configuration are destroyed and new Logging Collector appenders referring to the new Logging Collector configuration are added The Logging Collector configuration consists of two parts e the input configuration section e the output configuration section 7 1 Input configuration section 7 1 1 TCP input Field Description TCPHostStatus To enable disable the TCP input of the Logging Collector Allowed values ON OFF TCPHostPort The port number of the TCP input Table 7 1 TCP input configuration fields 7 1 2 TCP XML input Collector Allowed values ON OFF Table 7 2 TCP XML input configuration fields 7 2 Output configuration section 7 2 1 SocketAppender output Field Description SocketOutputStatus To enable disable the socketAppender output Allowed values ON OFF SocketOutputLogLevel Minimum log level enabled for the socketAppender output Allowed values DEBUG INFO WARN ERROR and FATAL see log4j levels Log4j Manual SocketOutputWorkingMode To select the socketAppender working
11. ME Collector FileConfiguration folder where lt TOMCAT_HOME gt is the TOMCAT installation folder Below the complete configuration file of the Logging Collector lt xml version 1 0 encoding UTF 8 gt lt CONFIGURATION gt lt INPUT CONFIGURATION gt lt INPUT gt lt TCPHostName gt TCPINPUT lt TCPHostName gt lt TCPHostStatus gt ON lt TCPHostStatus gt lt TCPHostPort gt 3333 lt TCPHostPort gt lt INPUT gt lt INPUT gt lt TCPHostXMLName gt TCPXMLINPUT lt TCPHostXMLName gt lt TCPHostXML Status gt ON lt TCPHostXML Status gt lt TCPHostXMLPort gt 3334 lt TCPHostX MLPort gt lt INPUT gt lt OUTPUT CONFIGURATION gt lt OUTPUT gt lt JMS gt lt JMSOutputName gt JMS lt JMSOutputName gt lt JMSOutputStatus gt OFF lt JMSOutputStatus gt lt JMSOutputLogLevel gt DEBUG lt JMSOutputLogLevel gt lt JMSOutputWorkingMode gt NO_QUEUE lt JMSOutputWorkingMode gt lt JMSOutputQueueMaxSize gt 1000 lt JMSOutputQueueMaxSize gt lt JMSOutputJNDIInitialContextFactory gt com sun jndi ldap LdapCtxFactory lt JMSOutputJNDIInitialContextFactory gt lt JMSOutputJNDIProviderURL gt Idap sadn02 389 oZIMQ dczinfn dc it lt JMSOutputJNDIProviderURL gt lt JMSOutputTopicName gt cn mt lt JMSOutputTopicName gt lt JMSOutputTopicConnectionFactory gt cn tcf lt JMSOutputTopicConnectionFactory gt lt JMSOutputMessageSelector gt NO lt JMSOutputMessageSelector gt lt OUTPUT gt OUTPUT
12. NO QUEUE QUEUE WITH LOST MSG and QUEUE WITH NO LOST MSG inserted in the queue queue size To enable disable the JMS message selector Table 7 5 JMS appender configuration fields gp You must enable the IMS message selector with the JMSOutputMessageSelector 2 property if you use a JMS selective subscription Page 19 of 38 Logging Collector Date 10 11 2005 Logging Collector functioning monitor To monitor the Logging Collector functioning you can use the Logging Collector monitoring web page Logging Collector V 3 0 Monitoring refresh Input section TCP INPUT TCP XML INPUT Status OFF Status OFF Connected Clients Connected Clients Online Connected Clients 0 Online Connected Clients 0 Received Messages Received Messages Output section DB APPENDER JMS APPENDER de erre Status OFF Status OFF Received Messages Received Messages 0 Lost Messages Lost Messages Queue Messages 0 0 Queue Messages 0 0 Sent Messages Sent Messages SOCKET APPENDER Status OFF Received Messages Lost Messages gx co T e Queue Messages Sent Messages Figura 8 1 Monitoring web page This page 1s a snapshot of the Logging Collector functioning To update the snapshot you can press the refresh button 6 1 Description of the monitoring web page fields The monitoring web page is split into tw
13. This is a help item e g How do I restart an executive if I lost connectio to the mw host This is an orientation item e g You have the choice between using a Semaphore or polling the channel The advantage of the first is bla bla the advantage of the second is bla bla x This is a tip e g To query a parameter several times use the timer in the window 3 Properties of the slected application Page 5 of 38 m Logging Collector Date 10 11 2005 Logging Collector 1 Overview The Logging Collector is a software component designed and developed to collect logging information from log4 compliant applications The Logging Collector allows also to store logging information in a persistent way in database and or to distribute publish it through a real time message system JMS Message System O Access via oor gt e Java and non Java applications Subscribers 0000009 Display System Access via JDBC Relational DB Oracle MySQL Figure 1 1 Logging Collector overview N What s logging information Logging information is a message written by developers in their software code can have a priority level 1 e DEBUG INFO WARN ERROR FATAL used for debug purposes in software applications human readable Page 6 of 38 Logging Collector Date 10 11 2005 2 Logging Collector architecture Logging Collector is compound by e aninput section e an
14. be able to send the logging information to the Logging Collector so their configuration files collectorClient scripts configFiles ProductorLog config are remoteHost host01 portHost 3333 e Logging Collector It must be configured to send the collected logging information to JMS Chainsaw and to DB The output section of the configuration file will be of the type JMSOutputStatus ON JMSOutputJNDIInitialContextFactory com sun jndi ldap LdapCtx Factory JMSOutputJNDIProviderURL Idap host04 389 o IMQ dc infn dc it JMSOutputTopicName cn mt JMSOutputTopicConnectionFactory cn tcf DBOutputStatus ON DBOutputUrl jdbc mysql host03 4306 testDB DBOutputUser test DBOutputPassword test DBOutputDriverClass com mysql jdbc Driver Page 26 of 38 Logging Collector Date 10 11 2005 e Chainsaw To use Chainsaw to receive and or to filter the logging information from JMS it s necessary to refer to chainsaw zip package in the Logging Collector s release After starting the Chainsaw by the startChainsaw sh script it is necessary to define an JMSReceiver through the Creates and configures a new receiver button and New JMSReceiver link and to configure it specifying jndiPath path of the jmsPlugin properties file see chainsaw zip properly configured name JMSReceiver s name only a label threshold minimum log level enabled for the JMSReceiver topicFactoryName topic connection factory topicName topic s name
15. der ViewAppenderMessage lt AppenderName gt To retrieve the message of the AppenderName appender Table 6 1 Logging Collector web service command The lt AppenderName gt parameter can be e SOCKET APPENDER e JMS APPENDER e DB APPENDER Page 16 of 38 Logging Collector Date 10 11 2005 Logging Collector configuration The Logging Collector configuration is performed by the following configuration web page Logging Collector V 3 0 Configuration Save amp Load Configuration Message from Collector Input section TCPINPUT TCPXMLIHPUT TCPHostStatus TCPHostXML Status TCPHostPort 3333 TCPHostXMLPort 3334 o utputsection eee DBOutputStatus JMSOutputStatus DBOutputLogLevel JMSOutputLogLevel reme DEBUG w WO DBOutputWorkingMode JMSOutputWorkingMode pre NOQUEUE sf _QUELIE DBOutputQueueMaxSize JMSOutputQueueMaxSize fe 100i DBOutpartUri jdbc mysql Mocalhosttest JMSCOutput JHDlinitialcContextFactory _ Fonsi ie corey com sun jndi Idap Ldaplt lt Factory DBOutputUser JMSOutputJNDIProviderURL Idap sadn02 389 0 M de inin de DBOutputPassword JMSOutputTopiclHame DBOutputDriverClass JMSOutputTopicConnectionFactory IMSOutputWiessagesSelector BE SocketOutput Status SocketOutputLogLevel SocketOutputWorkingMode MO GLIELIE SocketOutputQueueMaxSize 1000 SocketOutputHost localhost SocketOutputPort 4445 Figure 7 1 Logging Collector configuration page Page 17 of 38
16. der commands 6 2 Command web service 6 2 1 Available Web Service commands Logging Collector configuration 7 1 Input configuration section 7 1 1 TCP input 7 1 2 TCP XML input 7 2 Output configuration section 7 2 1 SocketAppender output 7 2 2 DBAppender output 7 2 3 JMSAppender output Logging Collector Date 10 11 2005 o CO cO 00 CO CO CON NN N Page 4 of 38 Logging Collector Date 10 11 2005 8 Logging Collector functioning monitor 20 8 1 Description of the monitoring web page fields 20 8 1 1 Input section 20 8 1 2 Output section 21 9 How applications send logging information to Logging Collector 22 9 1 Java application 22 9 2 Non Java application 22 10 How to display collected logging information 24 11 Examples of the Logging Collector use 25 11 1 Logging Collettor Chainsaw 25 11 2 Logging Collector JMS Chainsaw and DB 25 12 Frequently asked questions 28 13 Appendix A Configuration file 29 14 Appendix B Appender in detail 31 14 1 Appender structure 31 14 2 Appender working modes in detail 32 14 2 1 NO QUEUE working mode 32 14 2 2 QUEUE WITH LOST MSG working mode 99 14 2 3 QUEUE WITH NO LOST MSG working mode 34 15 Appendix C Example java 36 16 Appendix D Some useful web application parameters of the Logging Collector 37 17 References 38 This is a note e g Always put originator and targetAddr in your SOAP messages when sending SOAP messages to other XDAQ applications Pu
17. ender functioning Page 13 of 38 Logging Collector Date 10 11 2005 5 Logging Collector web surfing The following page displays the Logging Collector web surfing schema Command page main page Logging Collector V 3 0 Sabor FEROY Appender commands omm sima OFF Cai rese wno CED Ciao Coase se Hemme temono Configuration page Monitoring page VEEEEEAESMELLMEMLLLGCLLB i a Logging Collector V 3 0 Monitoring Seve di Law Configuration Bc Memaga drew GoWecter Rarach Input zactian l 3 i wri Ieee input section TB mas CF fim MIL Shatin i TC Pieri n T Pete Pori inea I Output section 1 pri T TRI on a Ld ee neo ree ema ai adde T E ae i ibe AA Bnr Ferte Meana PR leni FED pla mb esl Partt i pir tur rd ki i ge T cy Wicurgsaliser ped Abiti ripa Pe cade ici rm PEN cee neo luna Drscer Claas D ec AIAR apia acted mi BET i Gecken IE rn Figure 5 1 Logging Collector web surfing schema qe The url of the Logging Collector web application is http lt Host gt lt Port gt Collector where lt Host gt and lt Port gt are respectively the host name and the port of the web server where the Logging Collector is installed In the command page by pressing the Configure button yo
18. gura 14 1 Appender structure When the appender is in the STANDBY state the Connector process is activated to open a new connection to the output appender client and to keep the switches see figure 14 1 in the following positions e Ta switch in position 2 only for the first activation of the Connector process e Tb switch open e Tc switch in position 10 Once the connection is open the Connector process is destroyed after having set the switches in the new positions e Ta switch in position 1 e Tb switch close e Tc switch in position 9 The Sender process is activated at the end of the Connector process only if the appender is set to use its queue QUEUE_WITH_LOST_MSG or QUEUE_WITH_NO_LOST_MSG working mode The Ta switch is in position 2 After the first STANDBY to ON state transition will be always left in position 1 The Td switch is in position 3 when the appender is in QUEUE WITH LOST MSG or QUEUE WITH NO LOST MSG working mode otherwise is in position 4 Page 31 of 38 Logging Collector Date 10 11 2005 i The Te switch is in position 6 only when the appender is in QUEUE WITH LOST MSG working mode and the appender queue is full 14 2 Appender working modes in detail Each appender can function in one of the following modes e NO QUEUE e QUEUE WITH LOST MSG e QUEUE WITH NO LOST MSG 14 2 1 NO QUEUE working mode In this appender working mode the appender queue isn t used Path OFF to STANDBY STANDBY
19. gure 11 1 Example Logging Collector Chainsaw e ProductorLog application It must be able to send the logging information to the Logging Collector so its configuration file collectorClient scripts configFiles ProductorLog config 1s remoteHost host01 portHost 3333 e Logging Collector It must be configured to send the collected logging information to Chainsaw so its output section for the SocketAppender output 1s SocketOutputStatus ON SocketOutputHost host02 SocketOutputPort 4445 e Chainsaw Following the indications of the on line documentation Chainsaw site it must be defined an SimpleReceiver on the port number 4445 Now you can start the ProductorLog application and in a few time in Chainsaw will be displayed the logging information 11 2 Logging Collector JMS Chainsaw and DB In figure 11 2 is shown an example of use of the Logging Collector with a DB to build an historical archive of the logging information an JMS to distribute in real time logging information to JMS s subscribers Chainsaw for a graphical display of the logging information Page 25 of 38 Logging Collector Date 10 11 2005 Chainsaw ProductorLog lt I gt ProductorLog lt 2 gt Logging Collector ProductorLog lt N gt Client IMSCoallecto SOL Browser SOL Browser Figure 11 2 Example Logging Collector JMS Chainsaw and DB e ProductorLog applications They must
20. his mode there is de coupling between the inputs and the outputs N The appender in the STANDBY state after the ON to STANDBY state transaction inserts the logging information into its queue until it isn t full When the appender queue becomes full the logging information is lost 4 4 3 QUEUE WITH NO LOST MSG working mode The appender in this working mode inserts the logging information in its queue and handles immediately the next logging information The Sender process of the appender extracts the logging information from the queue and send it to the appender output client When the appender queue is full and a new logging information arrives to the appender the input client goes slow and the logging information isn t lost So in this mode there is de coupling between the inputs and the outputs only when the appender queue isn t full The appender in the STANDBY state after the ON to STANDBY state transaction inserts the logging information into its queue until it isn t full When the appender queue becomes full the logging information isn t lost because the input client slackens its speed 4 4 4 Example It is possible to configure the SocketAppender in the NO QUEUE working mode and the DBAppender with the QUEUE WITH NO LOST MSG working mode By these appender configurations the rundown caused by the DBAppender is cancelled out by the DBAppender queue In this way the rundown of the DBAppender doesn t involve the SocketApp
21. in the STANDBY state after the first OFF to STANDBY transition The appender is in QUEUE WITH LOST MSG working mode and its queue is full Page 21 of 38 Logging Collector Date 10 11 2005 9 How applications send logging information to Logging Collector Logging Collector is enabled to receive logging information through java log4j LoggingEvent objects org apache log4j spi LoggingEvent from java applications or through a stream in log4j compliant XML format from non java applications 9 Java application In appendix C there is the code of a dummy java application producing logging information In the constructor is defined and configured the logger and the socketAppender used to send the logging information to the Logging Collector N It must be used the NDC object org apache log4j NDC to set the necessary information to identify unambiguously the logging information origin In the NDC of the dummy application is only set the IP address of the host In some cases this information alone couldn t be enough N LocationInfo property must be set to true value to include the location information method class line information in the logging information too A In some cases it is necessary to set the ReconnectionDelay property Default values 30 seconds The appender can be also defined and configured from a property file in text format or in XML format see Log4j Manual It is advised to use the XML format
22. lt DB gt lt DBOutputName gt DB lt DBOutputName gt lt DBOutputStatus gt OFF lt DBOutputStatus gt lt DBOutputLogLevel gt DEBUG lt DBOutputLogLevel gt lt DBOutputWorkingMode gt NO_QUEUE lt DBOutputWorkingMode gt lt DBOutputQueueMaxSize gt 1000 lt DBOutputQueueMaxSize gt lt DBOutputUrl gt jdbc mysgl localhost test lt DBOutputUrl gt lt DBOutputUser gt guest lt DBOutputUser gt lt DBOutputPassword gt guest lt DBOutputPassword gt lt DBOutputDriverClass gt com mysql jdbc Driver lt DBOutputDriverClass gt lt OUTPUT gt OUTPUT lt SOCKET gt SiGRIDCC LE FSN l Page 29 of 38 Logging Collector Date 10 11 2005 lt SocketOutputName gt SOCKET lt SocketOutputName gt lt SocketOutputStatus gt OFF lt SocketOutputStatus gt lt SocketOutputLogLevel gt DEBUG lt SocketOutputLogLevel gt lt SocketOutputWorkingMode gt NO_QUEUE lt SocketOutputWorkingMode gt lt SocketOutputQueueMaxSize gt 1000 lt SocketOutputQueueMaxSize gt lt SocketOutputHost gt localhost lt SocketOutputHost gt lt SocketOutputPort gt 4445 lt SocketOutputPort gt lt OUTPUT gt lt CONFIGURATION gt Page 30 of 38 Logging Collector Date 10 11 2005 14 Appendix B Appender in detail 14 1 Appender structure The following figure shows in detail the appender structure Arrived Message Sent Message Appender Client Lost Message Legend Connector process Sender process Appender queue Fi
23. mmand is sent the Logging Collector configuration used 1s e The one previously saved in the configuration file see appendix A It is automatically loaded in the Logging Collector there is no need to use the configuration web page if the configuration isn t changed from the last use of the Logging Collector The one just updated by the configuration web page by pressing Save amp Load button Table 3 2 From READY to ENABLED transition From State To State ENABLED HALTED After this transaction the inputs of the Logging Collector are disabled whereas the appenders continue to be enabled Logging Collector is stopped to collect the logging information Table 3 3 From ENABLED to HALTED transition From State To State HALTED ENABLED After this transition the inputs are enabled appenders are already enabled Logging Collector is restarted to collect logging information Table 3 4 From HALTED to ENABLED transition From State To State HALTED READY This transition happens when the Logging Collector configuration is updated see the note in the paragraph 3 2 Table 3 5 From HALTED to READY transition Page 10 of 38 Logging Collector Date 10 11 2005 4 Logging Collector Appender core 4 1 Appender state machine Each appender has got an internal state machine spontaneous transaction Figure 4 1 Appender state machine Description Appender is neither enabled nor active Appender is enabled
24. mode Allowed values NO QUEUE QUEUE WITH LOST MSG and QUEUE WITH NO LOST MSG inserted in the queue queue size IP address or hostname to which the logging information is sent information is sent Table 7 3 Socket appender configuration fields Page 18 of 38 Logging Collector Date 10 11 2005 7 2 2 DBAppender output Field Description DBOutputStatus To enable disable the DBAppender output Allowed values ON OFF DBOutputLogLevel Minimum log level enabled for the DBAppender output Allowed values DEBUG INFO WARN ERROR and FATAL see log4j levels Log4j Manual DBOutputWorkingMode To select the DBAppender working mode Allowed values NO QUEUE QUEUE WITH LOST MSG and QUEUE WITH NO LOST MSG To set the number of the logging messages that can be inserted in the queue queue size The url of the database to which to connect Url in jdbc format subprotocol subname nameDatabase The user s password DBOutputPassword The user s password DBOutputDriverClass The JDBC driver class Table 7 4 DB appender configuration fields 7 2 3 JMSAppender output Field Description JMSOutputStatus To enable disabile the JMSAppender output Allowed values ON OFF JMSOutputLogLevel Minimum log level enabled for the JMSAppender output Allowed values DEBUG INFO WARN ERROR and FATAL see log4j levels Log4j Manual JMSOutputWorkingMode To select the JMSAppender working mode Allowed values
25. nctioning looses the connection to its output client it transits spontaneously from the ON state to STANDBY state The appender spontaneously comes back to the ON state if the connection is re established Table 4 4 From ON to STANDBY transition From State To State STANDBY The appender is disabled Table 4 5 From STANDBY to OFF transition From State To State REMOVE The appender is disabled Table 4 6 From ON to OFF transition Page 12 of 38 Logging Collector Date 10 11 2005 4 4 Appender working modes Each appender can work in one of the following modes e NO QUEUE e QUEUE WITH LOST MSG e QUEUE WITH NO LOST MSG For the details see appendix B 4 4 1 NO QUEUE working mode The appender in this working mode doesn t use its queue but it sends directly the logging information to its output client The appender doesn t handle the next logging information until it has not sent the previous one So in this mode there is no de coupling between the inputs and the outputs JA EERE DRINKS 4 4 2 QUEUE WITH LOST MSG working mode The appender in this working mode inserts the logging information in its queue and handles immediately the next logging information The Sender process of the appender extracts the logging information from the queue and sends it to the appender output client When the appender queue is full and a new logging information arrives to the appender the logging information is lost So in t
26. nfo property must be set to true 3 After restarting of the Logging Collector the logging information isn t collected anymore You must check if applications which send logging information are running and the ReconnectionDelay property has been opportunely set 4 Why in the monitoring web page there is a mismatch between the ReceivedMessages to the inputs and the ReceivedMessages to the appenders Because the monitoring web page is built dynamically and so it s possible happen Number of ReceivedMessages to the inputs 100 Number of ReceivedMessages to one appender 105 That it is correct It means that in the time gap between the retrieving of the ReceivedMessages number to the inputs and the retrieving of the ReceivedMessages number to the appender the Logging Collector has collected another five pieces of logging information 5 How do I select the appender queue size This is a delicate issue because on the one hand you would like to use a large appender queue size to decouple the input from the output of the Logging Collector on the other hand you would like to avoid an Out Of Memory error So it is advised to set an acceptable queue size In some performance tests for example it has been used a queue size of 15000 elements Page 28 of 38 Logging Collector Date 10 11 2005 13 Appendix A Configuration file The Logging Collector configuration CollectorConfiguration xml file is saved in the TOMCAT HO
27. o parts e Input section e Output section 6 1 1 Input section For each of the two Logging Collector inputs the following information is available Page 20 of 38 Logging Collector Date 10 11 2005 Field description Status of the input Connected Clients Number of the connected clients since the Logging Collector has been started Online Connected Clients Number of the connected clients at the present time Received Messages Number of the received messages Table 8 1 Input monitoring fields The input monitoring fields are reset to zero when the Logging Collector is stopped 6 1 2 Output section For each of the Logging Collector appenders the following information is available Field description Status of the appender Received Messages Number of received messages by the appender Number of lost messages into the appender Queue Messages Number of messages in the appender queue This field is in the format of Number of the Queue messages Queue size Sent Messages Number of messages sent to the output appender client Table 8 2 Appender monitorig fields N The appender monitoring fields are reset to zero when the appender is removed N The Queue Messages field isn t used set to 0 0 if the NO QUEUE appender working mode is selected N The Lost Messages field is increased when a logging message is received by the appender and one of the following conditions occurs The appender is
28. rs of the Logging Collector Parameter Default Value Available Parameter Values CollectorInternalLogLevel DEBUG OFF DEBUG INFO WARN ERROR FATAL Parameter Description To select the internal logging level of the Logging Collector Table 16 3 CollectorInternalLogLevel web application parameters of the Logging Collector For more details see Logging Collector Installation Guide Page 37 of 38 Logging Collector Date 10 11 2005 17 References 1 Logging Collector Installation Guide Logging Collector Installation Guide 2 Log4j Manual CeKi Gulcu log4j the complete manual 3 Log4j site http logging apache org log4j docs index html 4 Chainsaw site http logging apache org log4j docs chainsaw html 5 Axis Doc site Documentation for Axis Users http ws apache org axis java index html Page 38 of 38
29. the command sent CONFIGURE ENABLED START CONFIGURE Figure 3 1 Logging Collector state machine Description READY Logging Collector is ready It can be configured and or started ENABLED Logging Collector is collecting the logging information HALTED Logging Collector has been stopped Table 3 1 Logging Collector s states 3 2 Logging Collector working commands Logging Collector working commands are e Start Start command allows to start the collection of the logging information by creating the input receivers TCP Receiver and or TCPXML Receiver e Stop Stop command allows to stop the collection of the logging information by killing the input receiver The Logging Collector holds its current configuration and its outputs enabled e Configure Configure command allows to display the configuration web page Ne Configure When you press the Save amp Load button in the configuration web page the Logging Collector is cleared disabled both inputs and appenders It will start from scratch with the new configuration when the start command i1s sent e Monitor Monitor command allows to display the monitoring web page Page 9 of 38 Logging Collector Date 10 11 2005 3 3 Description of the transitions From State To State READY ENABLED After this transaction the inputs of the Logging Collector are enabled and the Logging Collector is enabled to collect logging information When the start co
30. tor for example by the command web service 6 1 5 Logging Collector Appender commands This section displays the state and allows the adding removing of each Logging Collector s appender add remove appender command It also allowes to view possible appender message if there is some problem to connect to the appender client viewMessage appender Page 15 of 38 Logging Collector Date 10 11 2005 6 2 Command web service The Logging Collector can be commanded by a command web service The Logging Collector exposes a command web service called CollectorService whose WSDL can be retrieved from the url http lt Host gt lt Port gt Collector services CollectorService wsdl lt Host gt and lt Port gt are respectively the host name and the port of the web server where the Logging Collector is installed In the collectorClientWebServiceCommand zip of the Logging Collector s release there are some clients of the CollectorService that can be executed by a script In the case it 1s necessary to develop an application to send commands to the Logging Collector by the CollectorService it is necessary to pick up the web service WSDL to create the stub and to call the methods of the web service see Axis Doc site 6 2 1 Available Web Service commands Through the web service it is possible to send only some commands to the Logging Collector RemoveAppender lt AppenderName gt To remove the AppenderName appen
31. u can surf to the Configuration web page whereas by pressing the Monitor button you can surf to the Monitoring web page Each web page is described in detail in the next paragraphs Page 14 of 38 Logging Collector Date 10 11 2005 6 Logging Collector command interface The Logging Collector can receive command both by a command web page and by a command web service 6 1 Command web page Logging Collector V 3 0 Status READY Message from _Reftesh Page Collector Appender commands DB APPENDER JMS APPENDER SOCKET APPENDER Status OFF Status OFF Status OFF Message Message Message Figura 6 1 Command web page The command web page 1s split into three sections e Logging Collector working commands e Refresh button and Message from Collector e Logging Collector Appender commands 6 1 1 Logging Collector working commands This section displays the current Logging Collector s state and allows to send configure monitor start and stop commands to the Logging Collector 6 1 2 Refresh button and Message from Collector This section displays messages from Logging Collector For example if a stop command is sent when the Logging Collector is in the Ready state a message This command 1s disabled 1s displayed In this section there is also a refresh button to get the updated collector s state and the updated appender s states This because there could be a concurrent use of the Logging Collec
32. ved logging information For more information you can see Chainsaw site The next Logging Collector version probably will provide a new graphical interface to retrieve to display and to filter the logging information BUG Chainsaw v2 Log Viewer File View Current tab Help a amp n e jej xss m v a S amp x Refine focus on G Root Logger ID Timestamp Level Logger Message amp Receivers J org 1 2005 03 29 10 08 49 158 amp 9 ong apache log4i c plugin org apache log4j net SocketReceiver 39ea em a ez lt Ed D x Nothing selected eornectedSock O hidden loggers name Simple Receiver paused 3 P Welcome Drag amp Drop XML log files here chainsaw log pot 4445 3 i mde m Ld TEC Welcome to Chainsaw v2 i 1 1 D 0 s Figure 10 1 Chainsaw Page 24 of 38 Logging Collector Date 10 11 2005 1 Examples of the Logging Collector use Now let s see some examples how to use the Logging Collector supposing to have already istalled all the necessary components see LoggingCollector Installation Guide 11 1 Logging Collettor Chainsaw In this example we want to display by Chainsaw the logging information produced by ProductorLog application collectorClient zip package ProductorLog annlication host03 host02 Logging Collector hostOl Fi
33. witch in position 5 The logging information is left into the appender queue and the appender input client slows down if the appender queue becomes full Table 14 13 QUEUE_WITH_NO_LOST_MSG mode From ON to STANDBY transition Transition Path STANDBY toOFF OFF Notes The appender is destroyed Table 14 14 QUEUE WITH NO LOST MSG mode From STANDBY to OFF transition Path ON to OFF JOB l oie Notes The appender is destroyed Table 14 15 QUEUE WITH NO LOST MSG mode From ON to OFF transition Page 35 of 38 15 Appendix C Example java import java net InetAddress import java net UnknownHostException import org apache log4j Level import org apache log4j Logger import org apache log4j NDC import org apache log4j net SocketAppender public class Example SocketAppender socketAppender null Logger log null er Constructor I public Example define the appender socketAppender new SocketAppender socketAppender setRemoteHost localhost socketAppender setPort 3333 socketAppender setThreshold Level DEBUG socketAppender setLocationInfo true socketAppender activateOptions define the logger log Logger getLogger SumClass class try NDC push InetAddress getLocalHost getHostAddress catch UnknownHostException uke do nothing j log setLevel Level DEBUG Attached the appender to logger log addAppender socketA ppender j param a
Download Pdf Manuals
Related Search
Related Contents
6ème journées d`études sur les carrières – Nantes 2009 L NUPILAC ELITE PRO Wagner SprayTech Power Painter User Manual of AP Controller - PLANET Technology Corporation. HT-SS1300 Getting Started Guide Manual de instrucciones DIRETRIZ DE AERONAVEGABILIDADE エコノシールJシリーズ・コネクタ〈マークⅡ(+)〉 Copyright © All rights reserved.
Failed to retrieve file