LogScissor is a JMS message producer that monitors on a remote log file and renames it into a new file with an id for download. It then creates a message with the full path of the new file and puts it into the internal XQueue as the notification. Therefore, the new file is able to be downloaded downstream in time. LogScissor supports flow control and XA. Fault tolerance with auto reconnections is built in.
LogScissor requires the remote log is slicable. The application of the log is supposed to open the log file to append for each log entry. Therefore, once the log gets renamed, a new log will be created on the new entries. So the operation is called slice.
Apart from the common properties, there are many implementation specific properties for LogScissor.
Property Name | Data Type | Requirement | Description | Examples |
---|---|---|---|---|
AutoClose | string of true or false | optional | flag to auto close ftp connection | true (default: false) |
StagingDir | string | optional | path to the staging aera for the downloaded logs | /var/log/qbroker/staging |
MaxFileSize | integer | optional | max number of bytes to store the content into message | 1024000 |
Heartbeat | integer | optional | interval in sec to check the log file | 5 (default: 30) |
Threshold | integer | optional | min number of bytes required to slice the log file | 5 (default: 30) |
SessionTimeout | integer | optional | timeout in second to slice the log file in case the file is small | 45 (default: 60) |
SOTimeout | integer | optional | timeout in second for TCP operation | 30 (default: 60) |
PropertyMap | map | optional | map for required properties | see example |
Here is an example of LogScissor:
{ "Name": "rcvr_notice_rlog", "ClassName": "org.qbroker.receiver.LogScissor", "URI": "ftp://panda1/var/log/qbroker/relay/notice_log", "Username": "qmadm", "Password": "xxxx", "LinkName": "root", "DisplayMask": "6", "Operation": "slice", "Heartbeat": "10", "SessionTimeout": "240", "AutoClose": "true", "Threshold": "50", "XAMode": "1", "TextMode": "1", "MaxFileSize": "4000000", "StagingDir": "/var/log/qbroker/staging", "PropertyMap": { "HostName": "HostName", "FileName": "FileName", "FileSize": "FileSize", "LocalStore": "LocalStore" }, "StringProperty": { "JMSType": "notice" } }where it monitors the log file, keyframe_log, on mam1svc4prod1. If it is not empty and the session expires, the receiver will rename the file and notifies the downstream by sending a message with the property of FileName set to the path of sliced log file. Once the downstream picks up the message, the log file will be downloaded.