When this article was created (April 2021), manually download every single log file is the only way to collect logs from Anypoint Platform Raw Data. However, the log files for the application are split into small file size and could have hundreds of files for short period. This article demonstrates a sample Mule application that has the capability to download a CloudHub application's log files by specifying a specific date.
Please note this application makes use of Monitoring Archive API
Docs
4. Run the application in the Anypoint Studio
5. Invoke the bulk download by sending curl request with required query parameters as the following
Query Parameters
curl "http://localhost:8081/download?envID=2abc2ce6-cce6-463b-afaa-a1979e3ffd29&appURL=helloworld-xjs-titanium.us-w2.cloudhub.io&year=2021&month=04&day=27&token=28297036-c7da-43c0-9a8c-15518baa5244"
6. Following log will be printed during the log download process to indicate begin and finish of the log download
INFO yyyy-MM-dd hh:mm:ss,mmm [[MuleRuntime].uber.xx: [bulkdownload].bulkdownloadFlow.CPU_LITE @4ac81462] [processor: bulkdownloadFlow/processors/0; event: 42e2e320-a977-11eb-9669-acde48001122] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: Start Raw Data Download INFO yyyy-MM-dd hh:mm:ss,mmm [[MuleRuntime].uber.xx: [bulkdownload].bulkdownloadFlow.BLOCKING @7ca4ce3a] [processor: bulkdownloadFlow/processors/9; event: 42e2e320-a977-11eb-9669-acde48001122] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: End Raw Data Download7. You can enable debug log by changing log4j2.xml log4j2 configuration file under /src/main/resources as the following
<AsyncLogger name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor" level="INFO"/>
TO
<AsyncLogger name="org.mule.runtime.core.internal.processor.LoggerMessageProcessor" level="DEBUG"/>
21 log file(s) downloaded in /Applications/7_AnypointStudio.app/Contents/Eclipse/plugins/org.mule.tooling.server.4.3.0.ee_7.3.5.202010151511/mule/./.mule/bulkdownload/2021430154525
Disclaimer: This example is provided as a reference for your own usage and is not to be considered a MuleSoft product. This example should be considered as a custom solution. The custom solution is not a Supported MuleSoft product.
001116258

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.