Upgrade Log Context

Liferay DXP 7.4 U72 / Liferay Portal 7.4 GA72

Enable the upgrade log context to display identifiers for upgrade related processes in your console logs. The possible identifiers are:

  • {upgrade.component=portal}: for upgrade processes related to portal
  • {upgrade.component=framework}: for processes related to the upgrade framework logic
  • {upgrade.component=<bundleSymbolicName>}: for upgrade processes related to modules

The logs can be enabled through the upgrade tool or at startup with a portal property.

If using the upgrade tool, set upgrade.log.context.enabled=true in your /tools/portal-tools-db-upgrade-client/portal-upgrade-ext.properties file.

If enabling upgrade at startup, set upgrade.log.context.enabled=true in your {Liferay-Home}/portal-ext.properties file.

Next, copy the portal-impl/src/META-INF/portal-log4j.xml file into bundles/tomcat/webapps/ROOT/WEB-INF/classes/META-INF and rename the file to portal-log4j-ext.xml. Then find the appender definition:

<Appender name="CONSOLE" type="Console">
	<Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m%n" type="PatternLayout" />
</Appender>

Change the definition to include %X, which tells Log4j to print the thread context information:

<Appender name="CONSOLE" type="Console">
	<Layout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%t][%c{1}:%L] %m %X%n" type="PatternLayout" />
</Appender>

Here are some example log lines that include the upgrade identifiers:

...
2023-05-24 23:29:31.143 INFO  [main][LoggingTimer:83] Starting com.liferay.portal.verify.VerifyProperties#verifySystemProperties {upgrade.component=portal}
2023-05-24 23:29:31.145 INFO  [main][LoggingTimer:44] Completed com.liferay.portal.verify.VerifyProperties#verifySystemProperties in 3 ms {upgrade.component=portal}
...
2023-05-24 23:29:34.012 INFO  [main][LoggingTimer:83] Starting com.liferay.portal.events.StartupHelperUtil#initResourceActions {upgrade.component=framework}
2023-05-24 23:29:34.029 INFO  [main][LoggingTimer:44] Completed com.liferay.portal.events.StartupHelperUtil#initResourceActions in 17 ms {upgrade.component=framework}
...
2023-05-24 23:30:17.046 INFO  [main][LoggingTimer:83] Starting com.liferay.portal.db.index.IndexUpdaterUtil#lambda$updateIndexes$1#Updating database indexes for com.liferay.wiki.service {upgrade.component=com.liferay.wiki.service}
2023-05-24 23:30:17.094 INFO  [main][BaseDB:776] Dropping stale indexes {upgrade.component=com.liferay.wiki.service}
2023-05-24 23:30:17.095 INFO  [main][BaseDB:846] drop index IX_18565130 on WikiPage {upgrade.component=com.liferay.wiki.service}
...

Enabling Together with the Upgrade Report

If the upgrade report is enabled together with the upgrade log context, the contents of the upgrade report will also be output in your console logs. Note, the report is displayed in a slightly different format than the upgrade_report.info files.

Upgrade report keyExplanation
upgrade.report.database.versionDatabase vendor and version.
upgrade.report.document.library.storage.sizeSize of the document library.
upgrade.report.errorsArray with the errors captured during the upgrade process. Grouped by origin, class, and number of occurrences of the same error.
upgrade.report.execution.dateDate and time when the report has been generated.
upgrade.report.execution.timeTotal time in seconds that the upgrade took to complete.
upgrade.report.longest.upgrade.processesArray with the 20 longest upgrade processes, indicating the name of the process and the time taken to complete each of them.
upgrade.report.portal.expected.build.numberExpected final build number after the upgrades are executed.
upgrade.report.portal.expected.schema.versionExpected schema version after the upgrades are executed.
upgrade.report.portal.final.build.numberActual final build number after the upgrades have been executed.
upgrade.report.portal.final.schema.versionActual final schema version after the upgrades have been executed.
upgrade.report.portal.initial.build.numberInitial build number before the upgrades are executed.
upgrade.report.portal.initial.schema.versionInitial schema version before the upgrades are executed.
upgrade.report.property.dl.store.implImplementation configured for the document library storage.
upgrade.report.property.liferay.homeAbsolute path to the Liferay home folder.
upgrade.report.property.localesArray with all the locales available.
upgrade.report.property.locales.enabledArray with all the locales enabled.
upgrade.report.property.rootDirAbsolute path to the document library root folder.
upgrade.report.resultResult of the upgrade calculated after all the upgrade have been executed.
upgrade.report.statusUpgrade information status provided by OSGi. It indicates if all the upgrades have been executed or there are pending upgrades.
upgrade.report.tables.initial.final.rowsArray with the name of all the tables and the number of rows on each table before and after the upgrades.
upgrade.report.typeType of the upgrade that has taken place (i.e. Major, minor, micro). Based on schema version.
upgrade.report.warningsArray with the warnings captured during the upgrade process. Grouped by origin, class, and number of occurrences of the same warning.

Using the Upgrade Database Tool Upgrade Report Database Upgrade Tool Reference Monitoring Upgrades with MBeans

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy