Skip to content

Browse local logs

Releasev0.35.0 · cfeceb67

mw dev logs collects container stdout/stderr and MediaWiki .log files for the current development context. Browse the copies in OpenSearch Dashboards; normal Docker logging and original log files stay unchanged, even while collection runs.

Terminal window
mw dev logs create

Open the MediaWiki log view, or follow the link on your development dashboard if you use another gateway port. Setup creates the mwcli-logs-* index pattern with @timestamp and a saved MediaWiki view automatically. Existing saved views and preferences survive subsequent starts.

Open your local wiki and reload a page or call its API. Refresh Discover and check that the time range covers your request. You should see file events with source=mediawiki_file and HTTP request/container events with source=container. Search message or filter by service, stream, or file path. Clear the saved service filter to browse other containers in this context.

/proxy/logs/app/observability-logs#/ lists saved queries and visualizations; “No Queries or Visualizations” does not mean no logs were collected. Click Event Explorer to open the query interface. It does not open the saved Discover view or automatically choose the log index. Enter:

source = `mwcli-logs-*` | where service = 'mediawiki'

Choose a time range covering your request, then run the query. Remove the where clause for all services, or use service = 'mediawiki-web' for HTTP access logs. See OpenSearch event analytics for PPL examples.

A running but idle wiki may not produce new entries. This is MediaWiki and container logging; it does not capture the mwcli binary’s host-terminal output.

Terminal window
mw dev logs stop # Keep collected logs and file checkpoints
mw dev logs start
mw dev logs destroy # Delete collected data; preserve original logs

Container collection is live; output produced while the collector is stopped may be missing. File collection catches up from retained files. There is no automatic index retention, so delete old indexes in Dashboards when needed.

Allow several GiB of spare Docker memory. Linux hosts may need vm.max_map_count=262144; see OpenSearch setup. Inspect startup or collection errors with:

Terminal window
mw dev compose logs -- --tail=100 logs-setup logs-opensearch logs-collector opensearch-dashboards

If startup failed, check logs-setup first. After fixing the cause, rerun mw dev logs create. It fills in missing setup without overwriting saved-view edits or user preferences. To reopen the supplied view after choosing another homepage, use /proxy/logs/app/discover#/view/mwcli-mediawiki-logs.


Read this guide offline with mw help guides dev logs.

Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.