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

EcoSys System Administration

Search by Category
Administration & Configuration
EcoSys Version

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. Copy the following files from ESFM_HOME to parent folder of lib folder. For example, batch folder which is immediate parent of lib folder.


    • log4j2.xml


  3. Navigate to batch folder > file, locate the section Database Connection Pool and add a pound (#) symbol in front of the following line to comment it:


  4. Navigate to batch folder > file, locate the section Batch Job Connection Pool. Remove the pound (#) symbol to uncomment the following lines. Edit the values if needed.








    If you are using SQL server, ignore the above two Oracle specific lines commented and uncomment the SQL Driver and Connect string as shown below


  5. Edit the log4j2.xml, and change value of "ESFM-Application.log" to point to a location under your batch folder. For example, "LogAnalyzer.log"

  6. Create a new properties file named in lib folder, and include the details as follows:


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

    notes=Your Notes Here

    environment=Your Environment

    • 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.

  7. 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.

  8. Run the following command: java -classpath * -DESFM_HOME=C:\EcoSys\batch

    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 * -DESFM_HOME=C:\EcoSys\batch

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

  10. The software updates the file with the metrics data captured during the log analysis.

  11. 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.