Menu

#68 Corrupted install log

open
nobody
None
5
2012-09-05
2012-09-05
Lacek
No

Problem:
Beginning portion of log messages from the build.xml is missing.

Explanation:
The log file of the installer (ant.install.log) contains 2 types of logs, 1 from the installer's SimpleLogger class and the other one from the Ant's DefaultLogger class.
In a complete execution of an installer, the installer first writes logs using SimpleLogger, and then during the Installer task Ant writes log using DefaultLogger. At the end, the installer will write some more logs using the SimpleLogger again.
The problem is the append attribute of FileWriter used in SimpleLogger is false, which means it's overwrites the message written by the DefaultLogger.

Solution:
A simple fix is to just change the append attribute for constructing the FileWriter in SimpleLogger to true. Another method which might be better is to shared the same stream/writer among the 2 logger, but there will be more changes.

Discussion


Log in to post a comment.