Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 8. Logging
Logging enables you to diagnose error and performance issues with AMQ Interconnect.
AMQ Interconnect consists of internal modules that provide important information about the router. For each module, you can specify logging levels, the format of the log file, and the location to which the logs should be written.
8.1. Logging Modules
AMQ Interconnect logs are broken into different categories called logging modules. Each module provides important information about a particular aspect of AMQ Interconnect.
8.1.1. The DEFAULT Logging Module
The default module. This module applies defaults to all of the other logging modules.
8.1.2. The ROUTER Logging Module
This module provides information and statistics about the local router. This includes how the router connects to other routers in the network, and information about the remote destinations that are directly reachable from the router (link routes, waypoints, autolinks, and so on).
					In this example, on Router.A, the ROUTER log shows that Router.B is the next hop. It also shows the cost for Router.A to reach the other routers on the network:
				
Tue Jun 7 13:28:27 2016 ROUTER (trace) Node Router.C next hop set: Router.B Tue Jun 7 13:28:27 2016 ROUTER (trace) Node Router.C valid origins: [] Tue Jun 7 13:28:27 2016 ROUTER (trace) Node Router.C cost: 2 Tue Jun 7 13:28:27 2016 ROUTER (trace) Node Router.B valid origins: [] Tue Jun 7 13:28:27 2016 ROUTER (trace) Node Router.B cost: 1
Tue Jun  7 13:28:27 2016 ROUTER (trace) Node Router.C next hop set: Router.B
Tue Jun  7 13:28:27 2016 ROUTER (trace) Node Router.C valid origins: []
Tue Jun  7 13:28:27 2016 ROUTER (trace) Node Router.C cost: 2
Tue Jun  7 13:28:27 2016 ROUTER (trace) Node Router.B valid origins: []
Tue Jun  7 13:28:27 2016 ROUTER (trace) Node Router.B cost: 1
					On Router.B, the ROUTER log provides more information about valid origins:
				
8.1.3. The ROUTER_CORE Logging Module
This module provides information about the local router’s operations on active connections and links. This includes operations related to opened and closed connections, messages sent, deliveries, and flow control.
Tue Jun 7 13:42:07 2016 ROUTER_CORE (trace) Core action 'link_flow' Tue Jun 7 13:42:08 2016 ROUTER_CORE (trace) Core action 'link_deliver' Tue Jun 7 13:42:08 2016 ROUTER_CORE (trace) Core action 'send_to' Tue Jun 7 13:42:08 2016 ROUTER_CORE (trace) Core action 'link_flow'
Tue Jun  7 13:42:07 2016 ROUTER_CORE (trace) Core action 'link_flow'
Tue Jun  7 13:42:08 2016 ROUTER_CORE (trace) Core action 'link_deliver'
Tue Jun  7 13:42:08 2016 ROUTER_CORE (trace) Core action 'send_to'
Tue Jun  7 13:42:08 2016 ROUTER_CORE (trace) Core action 'link_flow'8.1.4. The ROUTER_HELLO Logging Module
This module provides information about the Hello protocol used by interior routers to exchange Hello messages, which include information about the router’s ID and a list of its reachable neighbors (the other routers with which this router has bidirectional connectivity).
The logs for this module are helpful for monitoring or resolving issues in the network topology, and for determining to which other routers a router is connected, and the hop-cost for each of those connections.
					In this example, on Router.A, the ROUTER_HELLO log shows that it is connected to Router.B, and that Router.B is connected to Router.A and Router.C:
				
Tue Jun 7 13:50:21 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C']) Tue Jun 7 13:50:21 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B']) Tue Jun 7 13:50:22 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C']) Tue Jun 7 13:50:22 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B'])
Tue Jun  7 13:50:21 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C']) 
Tue Jun  7 13:50:21 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B']) 
Tue Jun  7 13:50:22 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C'])
Tue Jun  7 13:50:22 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B'])
					On Router.B, the ROUTER_HELLO log shows the same router topology from a different perspective:
				
Tue Jun 7 13:50:18 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C']) Tue Jun 7 13:50:18 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B']) Tue Jun 7 13:50:19 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.C area=0 inst=1465307411 seen=['Router.B'])
Tue Jun  7 13:50:18 2016 ROUTER_HELLO (trace) SENT: HELLO(id=Router.B area=0 inst=1465307413 seen=['Router.A', 'Router.C']) 
Tue Jun  7 13:50:18 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.A area=0 inst=1465307416 seen=['Router.B']) 
Tue Jun  7 13:50:19 2016 ROUTER_HELLO (trace) RCVD: HELLO(id=Router.C area=0 inst=1465307411 seen=['Router.B']) 8.1.5. The ROUTER_LS Logging Module
This module provides information about link-state data between routers, including Router Advertisement (RA), Link State Request (LSR), and Link State Update (LSU) messages.
Periodically, each router sends an LSR to the other routers and receives an LSU with the requested information. Exchanging the above information, each router can compute the next hops in the topology, and the related costs.
This example shows the RA, LSR, and LSU messages sent between three routers:
- 1
- Router.Asent LSR requests and an RA advertisement to the other routers on the network.
- 2
- Router.Areceived an LSU from- Router.B, which has two peers:- Router.A, and- Router.C(with a cost of- 1).
- 3
- Router.Areceived an LSR from both- Router.Band- Router.C, and replied with an LSU.
- 4
- Router.Areceived an LSU from- Router.C, which only has one peer:- Router.B(with a cost of- 1).
- 5
- After the LSR and LSU messages are exchanged,Router.Acomputed the router topology with the related costs.
8.1.6. The ROUTER_MA Logging Module
This module provides information about the exchange of mobile address information between routers, including Mobile Address Request (MAR) and Mobile Address Update (MAU) messages exchanged between routers. You can use this log to monitor the state of mobile addresses attached to each router.
This example shows the MAR and MAU messages sent between three routers:
- 1
- Router.Asent MAU messages to the other routers in the network to notify them about the addresses added for- my_queueand- my_queue_wp.
- 2
- Router.Areceived a MAR message in response from- Router.C.
- 3
- Router.Areceived another MAR message in response from- Router.B.
- 4
- Router.Csent a MAU message to notify the other routers that it added and address for- my_test.
- 5
- Router.Csent another MAU message to notify the other routers that it deleted the address for- my_test(because the receiver is detached).
8.1.7. The MESSAGE Logging Module
This module provides information about AMQP messages sent and received by the router, including information about the address, body, and link. You can use this log to find high-level information about messages on a particular router.
					In this example, Router.A has sent and received some messages related to the Hello protocol, and sent and received some other messages on a link for a mobile address:
				
8.1.8. The SERVER Logging Module
This module provides information about how the router is listening for and connecting to other containers in the network (such as clients, routers, and brokers). This includes the state of AMQP messages sent and received by the broker (open, begin, attach, transfer, flow, and so on), and the related content of those messages.
For example, this log shows details about how the router handled a link attachment:
8.1.9. The AGENT Logging Module
					This module provides information about configuration changes made to the router from either editing the router’s configuration file or using qdmanage.
				
					In this example, on Router.A, address, linkRoute, and autoLink entities were added to the router’s configuration file. When the router was started, the AGENT module applied these changes, and they are now viewable in the log:
				
8.1.10. The CONTAINER Logging Module
This module provides information about the nodes related to the router. This includes only the AMQP relay node.
Tue Jun 7 14:46:18 2016 CONTAINER (trace) Container Initialized Tue Jun 7 14:46:18 2016 CONTAINER (trace) Node Type Registered - router Tue Jun 7 14:46:18 2016 CONTAINER (trace) Node of type 'router' installed as default node
Tue Jun  7 14:46:18 2016 CONTAINER (trace) Container Initialized
Tue Jun  7 14:46:18 2016 CONTAINER (trace) Node Type Registered - router
Tue Jun  7 14:46:18 2016 CONTAINER (trace) Node of type 'router' installed as default node8.1.11. The ERROR Logging Module
This module provides detailed information about error conditions encountered during execution.
					In this example, Router.A failed to start when an incorrect path was specified for the router’s configuration file:
				
8.1.12. The POLICY Logging Module
This module provides information about policies that have been configured for the router.
					In this example, Router.A has no limits on maximum connections, and the default application policy is disabled:
				
Tue Jun 7 15:07:32 2016 POLICY (info) Policy configured maximumConnections: 0, policyFolder: '', access rules enabled: 'false' Tue Jun 7 15:07:32 2016 POLICY (info) Policy fallback defaultApplication is disabled
Tue Jun  7 15:07:32 2016 POLICY (info) Policy configured maximumConnections: 0, policyFolder: '', access rules enabled: 'false'
Tue Jun  7 15:07:32 2016 POLICY (info) Policy fallback defaultApplication is disabled8.2. Configuring Logging
You can specify the types of events that should be logged, the format of the log entries, and where those entries should be sent.
Procedure
- In the router’s configuration file, add a - logsection to set the default logging properties:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - module
- 
									Specify DEFAULT.
- enable
- The logging level. You can specify any of the following levels (from lowest to highest): - 
											trace- provides the most information, but significantly affects system performance
- 
											debug- useful for debugging, but affects system performance
- 
											info- provides general information without affecting system performance
- 
											notice- provides general information, but is less verbose thaninfo
- 
											warning- provides information about issues you should be aware of, but which are not errors
- 
											error- error conditions that you should address
- 
											critical- critical system issues that you must address immediately
 - To specify multiple levels, use a comma-separated list. You can also use - +to specify a level and all levels above it. For example,- trace,debug,warning+enables trace, debug, warning, error, and critical levels. For default logging, you should typically use the- info+or- notice+level. These levels will provide general information, warnings, and errors for all modules without affecting the performance of AMQ Interconnect.
- 
											
- timestamp
- 
									Set this to yesto include the timestamp in all logs.
 - For information about additional log attributes, see Log in the Configuration Reference. 
- Add an additional - logsection for each logging module that should not follow the default logging configuration:- log { module: MODULE_NAME enable: LOGGING_LEVEL ... }- log { module: MODULE_NAME enable: LOGGING_LEVEL ... }- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - module
- The name of the module for which you are configuring logging. For a list of valid modules, see Logging Modules You Can Configure.
- enable
- The logging level. You can specify any of the following levels (from lowest to highest): - 
											trace- provides the most information, but significantly affects system performance
- 
											debug- useful for debugging, but affects system performance
- 
											info- provides general information without affecting system performance
- 
											notice- provides general information, but is less verbose thaninfo
- 
											warning- provides information about issues you should be aware of, but which are not errors
- 
											error- error conditions that you should address
- 
											critical- critical system issues that you must address immediately
 - To specify multiple levels, use a comma-separated list. You can also use - +to specify a level and all levels above it. For example,- trace,debug,warning+enables trace, debug, warning, error, and critical levels. For default logging, you should typically use the- info+or- notice+level. These levels will provide general information, warnings, and errors for all modules without affecting the performance of AMQ Interconnect.
- 
											
 - For information about additional log attributes, see Log in the Configuration Reference. 
8.3. Viewing Log Entries
You may need to view log entries to diagnose errors, performance problems, and other important issues. A log entry consists of an optional timestamp, the logging module, the logging level, and the log message.
8.3.1. Viewing Log Entries on the Console
					By default, log entries are logged to the console, and you can view them there. However, if the output attribute is set for a particular logging module, then you can find those log entries in the specified location (stderr, syslog, or a file).
				
8.3.2. Viewing Log Entries on the CLI
					You can use the qdstat tool to view a list of recent log entries.
				
Procedure
- Use the - qdstat --logcommand to view recent log entries.- You can use the - --limitparameter to limit the number of log entries that are displayed. For more information about- qdstat, see qdstat man page.- This example displays the last three log entries for - Router.A:- qdstat --log --limit=3 -r ROUTER.A - $ qdstat --log --limit=3 -r ROUTER.A Wed Jun 7 17:49:32 2017 ROUTER_CORE (none) Core action 'link_deliver' Wed Jun 7 17:49:32 2017 ROUTER_CORE (none) Core action 'send_to' Wed Jun 7 17:49:32 2017 SERVER (none) [2]:0 -> @flow(19) [next-incoming-id=1, incoming-window=61, next-outgoing-id=0, outgoing-window=2147483647, handle=0, delivery-count=1, link-credit=250, drain=false]- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow