Log Forwarder for AIX, HP-UX, Linux, OSX/MacOS & Solaris/SunOS
This Java log forwarder plugin proves invaluable in scenarios where out-of-the-box New Relic logging solutions are absent for specific platforms, such as AIX, HP-UX, Solaris, OSX/MacOS, and Linux operating systems. It seamlessly integrates into environments running JDK 8 (& above) , providing a straightforward configuration process and effortless execution. Whether encountering unique system configurations or exploring diverse platforms, this plugin stands as a reliable solution for forwarding logs to New Relic, ensuring comprehensive observability across a broad spectrum of systems.
Download the release and extract the Zip file log-forwarder-plugin-v.x.z.zip
.
{
"api_key": "<ingest_key>",
"application_name": "nrlabs-java-loggerv1.0",
"log_check_interval_ms": 120000,
"api_url": "https://log-api.newrelic.com/log/v1",
"log_files": [
{
"name": "mylog-file",
"file": "/Users/gsidhwani/Documents/GitHub/NR-LOG/newrelic-java-logger/mylog.log",
"attributes": {
"logtype": "custom"
}
},
{
"name": "mynginx-logs",
"file": "/Users/gsidhwani/Documents/GitHub/NR-LOG/newrelic-java-logger/xyz.log",
"attributes": {
"logtype": "nginx"
}
}
]
}
- api_key: The API key used for authentication when sending logs to New Relic.
- application_name: The name of the application or service from which the logs are being collected.
- log_check_interval_ms: The interval, in milliseconds, at which the log forwarder checks for new log entries to send to New Relic.
- api_url: The URL of the New Relic log API endpoint where the logs will be sent.
- log_files: An array of log files to be monitored and forwarded.
- name: A descriptive name for the log file.
- file: The absolute path to the log file on the file system.
- attributes: Additional attributes or metadata associated with the log file, such as the logtype.
These parameters allow you to configure the log forwarder to monitor specific log files, collect log entries at regular intervals, and send them to New Relic for analysis and visualization. Adjust these settings according to your application's requirements and environment.
export LOG_CONFIG=config.json
java -jar log-forwarder-all.jar
Logging process started successfully...
Sending 296 log events to New Relic...
Logs sent to New Relic successfully: 2024-05-17T14:18:55.552
Sending 48 log events to New Relic...
Logs sent to New Relic successfully: 2024-05-17T14:22:57.194
Follow these steps to install and configure the log forwarder for your Java application.
./gradlew clean shadowJar
The jar log-forwarder/build/libs/log-forwarder-all.jar will be created.
![image](https://private-user-images.githubusercontent.com/113113837/331596770-6a482aec-9ef8-42bf-a443-627b82498f20.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4Mzg1MjMsIm5iZiI6MTcyMTgzODIyMywicGF0aCI6Ii8xMTMxMTM4MzcvMzMxNTk2NzcwLTZhNDgyYWVjLTllZjgtNDJiZi1hNDQzLTYyN2I4MjQ5OGYyMC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyNFQxNjIzNDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05OWE2YWI5ZWM0YTM2NGUxMzkzYjg4ZDU1NWFiMDE4MWRlNmFkNWQ2ZDM5M2RjOWIyOTU5MTU4NmZmOTliNGExJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.pfBdgC0_wGlAeVSuzP-JCe27r_zcoU1Sax7b1Qvg3EU)
New Relic has open-sourced this project. This project is provided AS-IS WITHOUT WARRANTY OR DEDICATED SUPPORT. Issues and contributions should be reported to the project here on GitHub.
We encourage you to bring your experiences and questions to the Explorers Hub where our community members collaborate on solutions and new ideas.
We encourage your contributions to improve Salesforce Commerce Cloud for New Relic Browser! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].
A note about vulnerabilities
As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.
If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.
New Relic Java Log Forwarder is licensed under the Apache 2.0 License.