'Adobe AEM package manager - how to show Activity log using curl

I am using curl to automate AEM package manager, but I would like to see the actual progress. What I am seeing in /crx/packmgr/index.jsp in the window on the lower right.

So for example if I build or install a large package, curls progress only shows me that it's still busy/waiting, but not what is actually going on.

I would like to see the log output like

Building package
A META-INF
A META-INF/MANIFEST.MF
A META-INF/vault
A META-INF/vault/config.xml
A META-INF/vault/filter.xml
A META-INF/vault/nodetypes.cnd
A META-INF/vault/properties.xml
A /.content.xml
A /content
A /content/.content.xml
...
Package built in 407377ms.

If there a way to get this info for the POST request

curl -u admin:admin -X POST 
'http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages
 /allmycontent-1.0.zip?cmd=build'

or can I get some other url to see the activity log?



Solution 1:[1]

please have a look at this post: https://stackoverflow.com/a/50325299/1514647

when adding a logger for the org.apache.jackrabbit.vault.packaging.impl.ActivityLog it will create entries:

05.05.2022 09:00:00.024 *INFO* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.ActivityLog group:packagname:1.0.0: CREATE
05.05.2022 09:00:00.024 *INFO* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.ActivityLog group:packagname:1.0.0: UPLOAD
05.05.2022 09:00:00.105 *INFO* [OsgiInstallerImpl] org.apache.jackrabbit.vault.packaging.impl.ActivityLog group:packagname:1.0.0: EXTRACT_SUB_PACKAGES ()

Additionally I recommend to set a logger for org.apache.jackrabbit.vault.fs.io.AbstractExporter

It will log out every single file which is added or extracted such as:

05.05.2022 09:00:00.314 *DEBUG* [qtp1496533170-1940] org.apache.jackrabbit.vault.fs.io.AbstractExporter A META-INF
05.05.2022 09:00:00.315 *DEBUG* [qtp1496533170-1940] org.apache.jackrabbit.vault.fs.io.AbstractExporter A META-INF/MANIFEST.MF
05.05.2022 09:00:00.315 *DEBUG* [qtp1496533170-1940] org.apache.jackrabbit.vault.fs.io.AbstractExporter A META-INF/vault
05.05.2022 09:00:00.315 *DEBUG* [qtp1496533170-1940] org.apache.jackrabbit.vault.fs.io.AbstractExporter A META-INF/vault/config.xml

After that you can have do a tail -f error.log in the crx-quickstart/logs folder

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 luckyluke