loganalysis

1.0.4 • Public • Published

Objective

The loganalysis module collects stdout and stderr messages and sends them to the IBM Monitoring and Analytics add-on in IBM Bluemix.

Procedure

To monitor log files, you must bind the add-on to an application. To bind the add-on and install the loganalysis module:

  1. Log in to Bluemix. From the DASHBOARD view, expand ADD-ONS, and click CONNECT AN ADD-ON.
  2. From the Bluemix CATALOG view, which is positioned at the group of Add-Ons for managing and monitoring applications, click the Monitoring and Analytics icon.
  3. To view more information about the add-on, click VIEW DOCS.
  4. Select the name of your application, if not already selected, and click CREATE. The "Restart Application" dialog displays.
  5. As you do not need to restart your application now, click CANCEL.
  6. In the left navigation bar, under "Manage Spaces" and "APPS", click the name of your application. A screen displays with a Monitoring and Analytics-xxxxx icon, where xxxxx is a randomized string that Bluemix generates to uniquely identify your application instance.
  7. Click the Monitoring and Analytics-xxxxx icon.
  8. To activate the monitoring data collector, push your application again when prompted. This step is required.
  9. If you want to bind the add-on to an application in a Node.js runtime, you must configure the data collector so that you can use the Log Analysis tab. If you have already installed Node.js, you may not need to install npm. If you have not installed npm, install it before you proceed.

a. To install the data collector module or to update an older version, run the following command from the root directory of your application:

    npm install loganalysis

b. To ensure that the data collector initializes, add the following code to the script that you use to start the application:

    require("loganalysis");
  1. (Optional) If you use the add-on to analyze the logs of an application that runs in a Node.js runtime, you can use the scala_bulkMessageEmitThreshold parameter to configure the threshold for bulk message emission. The threshold is measured in bytes. The default value is 250000. After the cache of log files in the application breaches this threshold, the log files are sent to the add-on for processing.

To set this threshold manually, add scala_bulkMessageEmitThreshold=<your_value> to the manifest.yml file used by your application. You can also use a command line terminal to set the threshold. For example, to set the threshold to 150000 bytes, enter the following command in the command line interface:

    cf set-env <application_name> scala_bulkMessageEmitThreshold 150000
  1. Switch to the command window where you previously issued your application cf push command, and issue the same cf push command again.
  2. Switch back to the Bluemix UI, and either refresh your browser or wait a few seconds for it to refresh itself. The tabbed UI view displays your application's availability and performance monitoring data.

Package Sidebar

Install

npm i loganalysis

Homepage

www.ibm.com

Weekly Downloads

84

Version

1.0.4

License

none

Last publish

Collaborators

  • pkbehera