le_java is one of several libraries that allow you to send log data directly to your Logentries account from your application. le_java supports both the log4j and logback logging libraries in java, and can be configured to work with either – in just a few steps! (Check out: github.com/logentries/le_java/blob/master/README.md for our complete tutorial.)
Once you have your application sending logs to your Logentries account, you can decide how you want to use them. Anywhere in your code that you have an important event or critical data, you can use one of the following to send a log; any valid string can be sent as an argument which will be appended to a default pattern as set in your .xml configuration file.
Assumes an instance of the logging object ‘log’ has been created, see the above linked tutorial.
log.debug("contents"); log.info("contents=” + someVariable); log.warn("contents=" + someVariable + “ other=“ + someOtherVariable); log.error("any valid string can go here”);
If you use logback or log4j already, the above should look familiar. The logentries le_java library allows you to use the existing syntax you have for logs, but they are now also forwarded to the Logentries log associated with the token you will have placed in the .xml configuration for logback or log4j, samples of which are included in le_java.
With the le_java library, you can easily put any log data you want into the logging methods argument as any valid string. You can concatenate one or more variables’ names and values which can subsequently be used for searches, tags, and alerts in the Logentries web app. You choose what data and events in your application are important to you and it will be logged in the format you prefer and sent directly to your Logentries account. Once there, it is always available for analysis in future, and you can easily build real-time alerting on top of these for immediate notification based on events or activities.
You can set the
Using the le_java library (github.com/logentries/le_java) you can send logs directly from your java application to your Logentries account. Once you’ve collected these logs, Logentries enables easy searching, tagging and alerting, visualizations and analytics that may otherwise be missed if you did not have this access.
Visit us at logentries.com/doc/ to see all of the cool things you can do with your log data.