EcoSys Log Analysis from Command Line - EcoSys - Administration & Configuration - Hexagon PPM

EcoSys System Administration

Language
English
Product
EcoSys
Search by Category
Administration & Configuration
EcoSys Version
8.7

Why use the Log Analyzer?

The Log Analyzer utility enables you to generate Excel log analysis files from text log files. The Excel analysis creates multiple worksheets that separate each type of information. You can run the Log Analyzer against the latest two log files directly from the EcoSys user interface. You can also run the utility from the command line using EcoSys batch to generate a log analysis for a specific file or for multiple files.

Run a log analysis from the command line

Running the Log Analyzer from the command line is a convenient way to analyze EcoSys log files without installing EcoSys or independently of the application server container.

  1. In the EcoSys distribution package, locate the batch\lib folder, and copy it to a separate folder on your target machine/server.

  2. Create a new properties file named LogAnalyzer.properties, and include the information shown below.

    inputfilename=C:/EcoSys/log/ESFM-Application.log

    outputfilename= C:/EcoSys/log/ESFM-Application-Log-Analysis.xls

    notes=Your Notes Here (Optional)

    environment=Your Environment (optional)

    • Modify the properties with the appropriate file and folder names. Use forward slash (/) as the file separator.

    • Make a note of the complete path of the properties file.

  3. Open a command prompt, and navigate to the folder in which you copied the contents of the batch\lib folder. For example cd C:\EcoSys\batch\lib.

  4. Run the following command: java -classpath * com.ecosysmgmt.fm.util.LogAnalyzer LogAnalyzer.properties

    The default heap size for any java application is 256 MB. When analyzing a large log file, configure minimum and maximum heap size appropriately:

    java –Xms1024m –Xmx1024m-classpath * com.ecosysmgmt.fm.util.LogAnalyzer LogAnalyzer.properties

  5. After the analysis is complete, the software creates the Excel log file and saves it in the folder specified in the outputfilename property.

  6. The software updates the LogAnalyzer.properties file with the metrics data captured during the log analysis.

  7. To generate a log analysis for another file, modify the inputfilename, outputfilename, notes, and environment properties that you defined in Step 2 with the appropriate file and folder names. All other entries in the properties file are automatically updated every time you run a log analysis.

How to merge multiple files

Running the Log Analyzer from the command line can generate the Excel analysis file using a single text file as input. To analyze multiple log files, you must merge all the files into a single log file.

Ensure that you merge the files in the correct order so that the timestamps of the log activity remain in order. Otherwise, the Log Analyzer may show data incorrectly.

The following command can be helpful in creating a single log file from multiple log files. The file names must be in the reverse order of creation. For example, the last log file created should be first in the list of files to be copied. To merge files from a command prompt:

  1. Open a command prompt.

  2. Navigate to the folder in which the raw log files are saved. An example command to merge four log files into one is shown below.

    copy /b ESFM-Application.log.3+ESFM-Application.log.2+ESFM-Application.log.1+ESFM-Application.log ALL_Logs.log

  • Yellow highlighted text indicates the command to copy multiple files in binary mode.

  • Green highlighted text indicates the list of files to be merged. This is where it is important to maintain the correct order of the files.

  • Blue highlighted text indicates the name of the merged file to which all the contents will be copied.