{"id":27890248,"url":"https://github.com/tibcosoftware/loglmi-appender","last_synced_at":"2025-05-05T10:46:04.926Z","repository":{"id":25756362,"uuid":"105791239","full_name":"TIBCOSoftware/loglmi-appender","owner":"TIBCOSoftware","description":"Java log appender for LogLogic","archived":false,"fork":false,"pushed_at":"2023-07-16T06:49:37.000Z","size":56,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T07:46:01.457Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TIBCOSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-04T16:28:26.000Z","updated_at":"2024-04-14T07:46:01.460Z","dependencies_parsed_at":"2022-08-28T14:40:16.465Z","dependency_job_id":null,"html_url":"https://github.com/TIBCOSoftware/loglmi-appender","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIBCOSoftware%2Floglmi-appender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIBCOSoftware%2Floglmi-appender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIBCOSoftware%2Floglmi-appender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TIBCOSoftware%2Floglmi-appender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TIBCOSoftware","download_url":"https://codeload.github.com/TIBCOSoftware/loglmi-appender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252485664,"owners_count":21755819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-05T10:46:04.324Z","updated_at":"2025-05-05T10:46:04.905Z","avatar_url":"https://github.com/TIBCOSoftware.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Copyright © 2017. TIBCO Software Inc.\n# TIBCO LogLogic® Logging Toolkit for Java\n## Using the LogLogic® logging extensions for Java\n### Introduction\n\nLogLogic logging extension for Java supports the following logging backend:\n\n* Java JDK Logging framework\n* Log4j (1.x)\n* Log4j 2 (2.x)\n* Logback\n\nLogLogic logging extension for Java requires at least Java 7.\n\nThis works with any Log Management Intelligence version. Also, use LSP 33 and above if using application strings.\n\n### Choosing between TCP or ULDP transport\n  \nMany logging framework are provided with a UDP Syslog implementation, which suffers some shortcomings for deployment in enterprise systems.\n\nThe appenders provided by TIBCO LogLogic® Log Management Intelligence (LMI) overcome those limitations, using two protocols. \n\nThe standard Syslog over TCP (RFC 6587, RFC 5425), which works with LogLogic® LMI and is interoperable with other applications supporting the syslog framework.\nThis protocol uses a reliable transport, can support any message length that the receiver can accept, and can be optionally secured by a TLS encapsulation.\n\nAlso provided is an appender for Syslog/ULDP. ULDP is a protocol created by LogLogic to add some additional reliability to the exchange of log messages: the receiving end is sending periodic acknowledgements of messages received once they are processed properly. Messages sent and not yet acknowledged are put in a memory buffer, when the buffer is full forwarding is paused until an acknowledgement is received (this situation happens if the receiving end cannot cope well with the pace at which events are sent).\n\nComparison of the features of the protocols.\n\nProperty          | Syslog UDP | Syslog TCP | ULDP\n----------------| -----------| -----------|-----\nMessages\u003e65k    |No          |Yes         |Yes\nAcknowledgement of processing of the messages by receiver | No | No | Yes\nSupports TLS encryption of connection|No|Yes|Yes\n\n### Properties of the LogLogic appenders\n\nProperty Name|Default Value|Type|Syslog/TCP|Syslog/ULDP\n-------------|-------------|-------|----------|------------\nhost         |             |String |X         |X\nport|514|Integer|X|X\nmaxQueueSize|500kb|String|X|X\nappName||String|X|X\nsource||String|X|X\nrawMode|false|Boolean|X|X\nfacility|16|Integer|X|X\nuseCompression|false|Boolean|X|X\nuseTls|false|Boolean|X|X\nuseEncryption|true|Boolean|X|X\nkeystorePath||String|X|X\nkeystorePassword||String|X|X\ntlsProtocolName|TLS|X|X\ncipherSuite|(*)|String|X|X\ndomainName||String||X\nnoServerAuth|false|Boolean|X|X\nuseOctetCounting|False|Boolean|X|\nsoTimeout|0|Long|X|X\nacceptedCertificateFingerpints|X|String|X|X\nignoreHostnameValidation|True(ULDP) False(TCP)|Boolean|X|X\n\n\n(*): For Syslog/TCP and ULDP (with encryption), default is TLS_RSA_WITH_AES_128_CBC_SHA.\n\nFor the accepted certificate fingerprints, the list of the fingerprints of the accepted certificates are separated by ‘,’. \nThe fingerprint is prepended with an ASCII label identifying the hash function followed by a colon.\nImplementations MUST support SHA-1 as the hash algorithm and use the ASCII label \"sha-1\" to identify the SHA-1\nalgorithm. The length of a SHA-1 hash is 20 bytes and the length of the corresponding fingerprint string is 65\ncharacters. An example certificate fingerprint is:\n`sha-1:E1:2D:53:2B:7C:6B:8A:29:A2:76:C8:64:36:0B:08:4B:7A:F1:9E:9D`\n\n**Note on best practice for appName field:**\nWe recommend you use a compound value for the appName field, that contains a protuct type and an app-name separated by an hyphen: `\u003cproductType\u003e-\u003capplicationName\u003e`. This helps creating data model that are generic for a given product, while keeping the notion of\nthe application name available for further refinement.\n\n## Use LogLogic appender with Java logging framework\n\nAdding loglmi-appender-1.0.0.jar in the classpath of your application.\n\n### Configuration\n\nSet the JVM property `java.util.logging.config.file` to point to the configuration file.\n\nThe file is a standard property file. \nProperties for configuring a Syslog TCP connections are prefixed with :\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.\n\nProperties for configuration an ULDP connection are prefixed with:\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.\n\nBelow is an example of a configuration file which defines two handlers, one for TCP, one for ULDP on their default port. The format of the log message can be defined using a SimpleFormater if necessary, as it is the case in the example.\n\n````xml\n# Properties file which configures the operation of the JDK\n# logging facility. This file contains setting for Syslog TCP Appender\n\n# The system will look for this config file, first using\n# a System property specified at startup:\n#\n# \u003ejava -Djava.util.logging.config.file=myLoggingConfigFilePath\n#\n# If this property is not specified, then the config file is\n# retrieved from its default location at:\n#\n# JDK_HOME/jre/lib/logging.properties\n\n# The set of handlers to be loaded upon startup.\n# Comma-separated list of class names.\nhandlers = com.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler, com.tibco.loglogic.logging.handlers.jdk.UldpHandler\n\n# Default global logging level.\n# Loggers and Handlers may override this level\n.level = INFO\n\n# Set the default logging level for the special LMI logger\nlmi.logger = INFO\n\n# Set the default logging level for new SyslogTcpHandler instances\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.level=INFO\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.host=192.168.7.170\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.port=514\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.maxQueueSize=5MB\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.appName=MyFancyApp\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.source=MyMachine\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.facility=16\ncom.tibco.loglogic.logging.handlers.jdk.SyslogTcpHandler.formatter= java.util.logging.SimpleFormatter\n# Set the default logging level for new SyslogTcpHandler instances\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.level=INFO\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.host=192.168.5.5\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.maxQueueSize=5MB\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.appName=MyFancyAppUldp\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.source=MyMachineUldp\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.facility=16\ncom.tibco.loglogic.logging.handlers.jdk.UldpHandler.formatter= java.util.logging.SimpleFormatter\n\njava.util.logging.SimpleFormatter.format = \"%1$F %1$r %4$s: %6$s\"\n````\n\n## Use LogLogic appenders with Log4j (1.x)\n\nAdding loglmi-appender-1.0.0.jar in the classpath of your application.\n\n### Configuration\n\nBy default, the LogManager looks for a file named `log4j.xml` in the CLASSPATH.\n\nBelow is an example of a configuration file, which defines two Appenders, one for TCP, one for ULDP on their default port. The format of the log message can be defined using a Layout if necessary, as it is the case in the example.\n\n````xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003c!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\"\u003e\n\u003clog4j:configuration\u003e\n\n    \u003cappender name=\"LoglogicAppender\" class=\"com.tibco.loglogic.logging.appenders.log4j.SyslogTcpAppender\"\u003e\n        \u003cparam name=\"host\" value=\"192.168.7.170\"/\u003e\n        \u003cparam name=\"appName\" value=\"myApp\"/\u003e\n        \u003clayout class=\"org.apache.log4j.PatternLayout\"\u003e\n            \u003cparam name=\"ConversionPattern\" value=\"%-5p %c{1} - %m\"/\u003e\n        \u003c/layout\u003e\n    \u003c/appender\u003e\n\n    \u003cappender name=\"LoglogicUldp\" class=\"com.tibco.loglogic.logging.appenders.log4j.UldpAppender\"\u003e\n        \u003cparam name=\"host\" value=\"192.168.7.170\"/\u003e\n        \u003cparam name=\"appName\" value=\"myAppUldp\"/\u003e\n        \u003clayout class=\"org.apache.log4j.PatternLayout\"\u003e\n            \u003cparam name=\"ConversionPattern\" value=\"%-5p %c{1} - %m\"/\u003e\n        \u003c/layout\u003e\n    \u003c/appender\u003e\n\n    \u003croot\u003e\n        \u003clevel value=\"INFO\" /\u003e\n        \u003cappender-ref ref=\"LoglogicAppender\" /\u003e\n        \u003cappender-ref ref=\"LoglogicUldp\" /\u003e\n    \u003c/root\u003e\n\n\u003c/log4j:configuration\u003e\n````\n\n## Use LogLogic appenders with Log4j 2 (2.x)\n\nAdding loglmi-appender-1.0.0.jar in the classpath of your application.\n\n### Configuration\n\nLog4j will inspect log4j.configurationFile system property to determine log4j2 configuration file. Log4j configuration can be written in JSON, YAML and XML\n\nIn case *no system property is defined* the configuration order takes below precedence:\n1. Property ConfigurationFactory will look for `log4j2-test.properties` in the classpath.\n1. YAML ConfigurationFactory will look for `log4j2-test.yaml` or `log4j2-test.yml` in the classpath.\n1. JSON ConfigurationFactory will look for `log4j2-test.jsn` or `log4j2-test.json` in the classpath.\n1. XML ConfigurationFactory will look for `log4j2-test.xml` in the classpath.\n1. Property ConfigurationFactory will look for `log4j2.properties` on the classpath\n1. YAML ConfigurationFactory will look for `log4j2.yml` or `log4j2.yaml` in the classpath.\n1. JSON ConfigurationFactory will look for `log4j2.jsn` or `log4j2.json` in the classpath.\n1. XML ConfigurationFactory will look for `log4j2.xml` in the classpath.\n\nBelow is an example of an XML configuration file, which defines two Appenders, one for TCP, one for ULDP on their default port. The format of the log message can be defined using a PatternLayout if necessary, as it is the case in the example.\n\n````xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cConfiguration packages=\"com.tibco.loglogic.logging.appenders.log4j2\"\u003e\n    \u003cAppenders\u003e\n        \u003cSyslogTcpAppender name=\"Loglogic\"\n                           host=\"192.168.7.170\"\n                           port=\"514\"\n                           appName=\"myApp\"\u003e\n            \u003cPatternLayout pattern=\"%X %x %m\"/\u003e\n        \u003c/SyslogTcpAppender\u003e\n        \u003cUldpAppender name=\"LoglogicUldp\"\n                           host=\"192.168.7.170\"\n                           appName=\"myAppUldp\"\u003e\n            \u003cPatternLayout pattern=\"%X %x %m\"/\u003e\n        \u003c/UldpAppender\u003e\n    \u003c/Appenders\u003e\n\n    \u003cLoggers\u003e\n        \u003cRoot level=\"INFO\"\u003e\n            \u003cAppenderRef ref=\"Loglogic\"/\u003e\n            \u003cAppenderRef ref=\"LoglogicUldp\"/\u003e\n        \u003c/Root\u003e\n    \u003c/Loggers\u003e\n\u003c/Configuration\u003e\n````\n\n## Using LogLogic appenders with logback\n\nAdding loglmi-appender-1.0.0.jar in the classpath of your application.\n\n### Configuration\n\n1. Logback tries to find a file called `logback-test.xml` in the classpath.\n1. If no such file is found, logback tries to find a file called `logback.groovy` in the classpath.\n1. If no such file is found, it checks for the file `logback.xml` in the classpath..\n1. If no such file is found, service-provider loading facility (introduced in JDK 1.6) is used to resolve the implementation of `com.qos.logback.classic.spi.Configurator` interface by looking up the file `META-INF\\services\\ch.qos.logback.classic.spi.Configurator` in the class path. Its contents should specify the fully qualified class name of the desired Configurator implementation. \n\nBelow is an example of a configuration file, which defines two Appenders, one for TCP, one for ULDP on their default port. The format of the log message can be defined using a layout if necessary, as it is the case in the example.\n\n````xml\n\u003cconfiguration\u003e\n    \u003cappender name=\"loglogic\" class=\"com.tibco.loglogic.logging.appenders.logback.SyslogTcpAppender\"\u003e\n        \u003chost\u003e192.168.7.170\u003c/host\u003e\n        \u003cPort\u003e514\u003c/Port\u003e\n        \u003clayout class=\"ch.qos.logback.classic.PatternLayout\"\u003e\n            \u003cpattern\u003e[%thread] %level: %msg\u003c/pattern\u003e\n        \u003c/layout\u003e\n        \u003csource\u003eMySource\u003c/source\u003e\n        \u003cappName\u003eMyApp\u003c/appName\u003e\n    \u003c/appender\u003e\n\n    \u003cappender name=\"uldp\" class=\"com.tibco.loglogic.logging.appenders.logback.UldpAppender\"\u003e\n        \u003chost\u003e192.168.5.5\u003c/host\u003e\n        \u003clayout class=\"ch.qos.logback.classic.PatternLayout\"\u003e\n            \u003cpattern\u003e[%thread] %level: %msg\u003c/pattern\u003e\n        \u003c/layout\u003e\n        \u003csource\u003eMySourceForULDP\u003c/source\u003e\n        \u003cappName\u003eMyAppForULDP\u003c/appName\u003e\n    \u003c/appender\u003e\n\n    \u003clogger name=\"uldp.logger\" additivity=\"false\" level=\"INFO\"\u003e\n        \u003cappender-ref ref=\"uldp\"/\u003e\n    \u003c/logger\u003e\n\n    \u003croot level=\"INFO\"\u003e\n        \u003cappender-ref ref=\"uldp\"/\u003e\n    \u003c/root\u003e\n\n\u003c/configuration\u003e\n````\n\n## Using the LmiLogEvent class\n\nThe toolkit also provides a helper class to generate well-formatted log messages, using a pre-defined set of properties that the LogLogic LMI advanced parsers natively understand.\n\nLogs are easier to query and act upon with correlation rules and reports if they share a common set of properties. The LogLogic team has come up with a pre-defined set of properties that suits a broad range of log messages from various kinds of product. This is extensible to suit your own needs, so you can define your own attributes.\n\nWe recommend that each log message is associated with an eventName and eventId that will help quickly extract the semantic of each log.\n\nHere is a typical use of that class:\n\n````java\nLogger logger = LoggerFactory.getLogger(...);\nLmiLogEvent event = new LmiLogEvent(\"Failed Login\",\"sshd:failure\");\nevent.setTargetUser(\"joe\");\nevent.addKVP(\"myOwnFieldName\", \"some value\");\nlogger.info(event.toString());\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibcosoftware%2Floglmi-appender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftibcosoftware%2Floglmi-appender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftibcosoftware%2Floglmi-appender/lists"}