|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: Windows |
| 4 | +--- |
| 5 | + |
| 6 | +## Cookbook |
| 7 | + |
| 8 | +### View application logs using Powershell |
| 9 | + |
| 10 | +This command saves you having to use Windows Event Viewer. It gets the 5 most recent logs from the `Application` log, for the source (application) named `Alloy`: |
| 11 | + |
| 12 | +``` |
| 13 | +Get-EventLog -LogName Application -Source Alloy -Newest 5 | format-table -wrap |
| 14 | +``` |
| 15 | + |
| 16 | +Gives a readable, wrapped output like this: |
| 17 | + |
| 18 | +``` |
| 19 | +PS C:\Users\azureuser> Get-EventLog -LogName Application -Source Alloy -Newest 5 | format-table -wrap |
| 20 | +
|
| 21 | + Index Time EntryType Source InstanceID Message |
| 22 | + ----- ---- --------- ------ ---------- ------- |
| 23 | + 2136 Feb 02 13:53 Information Alloy 1 ts=2026-02-02T13:53:50.4427297Z level=info |
| 24 | + msg="series GC completed" component_path=/remotecf |
| 25 | + g/self_monitoring_metrics.default |
| 26 | + component_id=prometheus.remote_write.default |
| 27 | + subcomponent=wal duration=568.3µs |
| 28 | +
|
| 29 | + 2135 Feb 02 13:53 Information Alloy 1 ts=2026-02-02T13:53:50.1793796Z level=info |
| 30 | + msg="series GC completed" component_path=/ compone |
| 31 | + nt_id=prometheus.remote_write.metrics_service |
| 32 | + subcomponent=wal duration=369.1µs |
| 33 | +
|
| 34 | + 2130 Feb 02 12:32 Information Alloy 1 ts=2026-02-02T12:32:47.8926766Z level=info |
| 35 | + msg="usage report sent with success" |
| 36 | +
|
| 37 | + 2129 Feb 02 12:32 Information Alloy 1 ts=2026-02-02T12:32:47.7702492Z level=info |
| 38 | + msg="reporting Alloy stats" |
| 39 | + date=2026-02-02T12:32:47.770Z |
| 40 | +
|
| 41 | + 2124 Feb 02 11:53 Information Alloy 1 ts=2026-02-02T11:53:50.014528Z level=info |
| 42 | + msg="WAL checkpoint complete" component_path=/remo |
| 43 | + tecfg/self_monitoring_metrics.default |
| 44 | + component_id=prometheus.remote_write.default |
| 45 | + subcomponent=wal first=95 last=96 |
| 46 | + duration=51.352ms |
| 47 | +``` |
0 commit comments