3

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?

Reporter
  • 3,897
  • 5
  • 33
  • 47

2 Answers2

2

There is an easy way to do this using the following way:

curl -ku admin:admin -F file=@"package-1.0.zip" -F force=true http://localhost:4502/crx/packmgr/service.jsp

curl -F cmd=install -F extractOnly=true "http://localhost:4502/crx/packmgr/service/script.html/etc/packages/my_packages/package-1.0.zip"

The second command will print the progress as HTML output, e.g. the same that gets shown in the activity window in the package manager.

-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 ()

Local access of logs: After that you can do a tail -f error.log in the crx-quickstart/logs folder

Remote access of logs: http://host:port/system/console/slinglog/tailer.txt?tail=10000&grep=*&name=%2Flogs%2Ferror.log

luckyluke
  • 491
  • 7
  • 16
  • Thanks, but the logs are only available locally on the same machine - I am looking for a way to access this from remote (e.g. my Jenkins instance), e.g. some URL as I said in my question. – Deeepdigger May 11 '22 at 10:07
  • The maven verbose option in the linked post switches on logging, but it does not say how to access the log data. – Deeepdigger May 11 '22 at 10:15
  • 1
    Sorry for the long wait. I think it's possible via the url `http://host:port/system/console/slinglog/tailer.txt?tail=10000&grep=*&name=%2Flogs%2Ferror.log` Before you need to turn on the loggers as described above. You can also write to a different log file, to have the package installation log separated. You need to submit Basic Auth. – luckyluke May 31 '22 at 20:18