Skip to content

Commit cf7b85b

Browse files
Update README.md.
1 parent 17bd78b commit cf7b85b

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
## bootlogger
1919
bootlogger is a command-line tool for Windows that logs system restart events, commonly known as a [reboot](https://en.wikipedia.org/wiki/Reboot). It records the date and time of each reboot, along with the computer name, and optionally the Windows version and build info. The log file name and location can be specified and the boot time can be formatted in any of more than a dozen date/time formats. bootlogger can also add itself to the Windows registry to run automatically at startup, ensuring that all reboots are logged. BTW, the name is "bootlogger", all lowercase.
2020

21-
## Why bootlogger?
22-
Perhaps you've seen my [Windows Update Viewer](https://github.com/Timthreetwelve/WUView) app or maybe [Get My IP](https://github.com/Timthreetwelve/GetMyIP) or one of the others. I needed to take a short break from maintaining those and felt like trying something new. I'd read good things about the [Go language](https://go.dev) and decided to give it a go _(pun intended)_. I was using a PowerShell script to log reboots, so I decided that rewriting it in Go would be a good project. The result is what you see here. I found it easy to get started with Go. Easier than writing this README file!
21+
## Why bootlogger and Why Go?
22+
Perhaps you've seen my [Windows Update Viewer](https://github.com/Timthreetwelve/WUView) app or maybe [Get My IP](https://github.com/Timthreetwelve/GetMyIP) or one of the others. I needed to take a short break from maintaining those and felt like trying something new. I'd read good things about the [Go language](https://go.dev) and decided to give it a go _(pun intended)_. I was using a PowerShell script to log reboots, so I decided that rewriting it in Go would be a good first project. The result is what you see here. I found it easy to get started with Go. The [Cobra](https://github.com/spf13/cobra) and [Viper](https://github.com/spf13/cobra) packages made things a lot easier
2323

2424
## What it logs
2525
#### Computer name
@@ -38,7 +38,7 @@ The build number comes from combining the `CurrentBuildNumber` value with the `U
3838
The computer name, reboot date and time, and the Windows version and build are written as a single record to the log file. As noted above, the logging of the version and build info is optional. That is controlled by the `no-buildinfo` option discussed below.
3939

4040
## Usage
41-
Running bootlogger without any additional commands or flags will write a record to the log file using the default configuration or the updated configuration found in environment variables, a configuration file, and/or command-line flags.
41+
Running bootlogger without any additional commands or flags will write a record to the log file using the default configuration or the updated configuration found in environment variables, a configuration file, and/or command-line flags. _Continue reading for examples_.
4242

4343
## Commands
4444
Before discussing configuration, a few words about commands. Commands can be differentiated from flags by the fact that they don't begin with the dash, or two dashes, that flags use.
@@ -58,10 +58,10 @@ or check its current status. When enabled, bootlogger will be added to the Windo
5858
Use `bootlogger.exe [command] --help` for more information about any of these commands.
5959

6060
#### Example command output:
61-
```powershell
62-
bootlog.exe printconfig
61+
```cmd
62+
bootlogger.exe printconfig
6363
bootlogger configuration:
64-
logfile = ./bootlogger.test.log
64+
logfile = D:\Logs\bootlogger.test.log
6565
namewidth = 12
6666
no-buildinfo = true
6767
no-text = false
@@ -82,13 +82,13 @@ Configurable options are:
8282

8383
|Option|Type|Default value|Description|
8484
|------|----|-------------|-----------|
85-
|`dryrun`|Boolean|`false`|Write log line to console but not to the log file.|
86-
|`logfile`|String|`./bootlog.txt`|Log file filename with path. Use quotes if there are spaces in the path.|
87-
|`namewidth`|Integer|`14`|Minimum computer name width. Longer names are not truncated. Shorter names are padded with spaces.|
88-
|`no-buildinfo`|Boolean|`false`|Version and build info will not be included in the log entry.|
89-
|`no-text`|Boolean|`false`|The descriptive text "was rebooted on" will not be included in the log entry.|
90-
|`quiet`|Boolean|`false`|Quiet operation. Do not print non-error messages to the console.|
91-
|`timeformat`|String|`12Hour`|Date/Time format. Use `12Hour` for 12 hour, `24Hour` for 24 hour or most of the Go pre-defined formats. _DateOnly and TimeOnly are not included_. See https://pkg.go.dev/time#pkg-constants for details. |
85+
|`dryrun`|Boolean|`false`|Write log line to console but _**not**_ to the log file. Useful for testing.|
86+
|`logfile`|String|`bootlog.txt`|Log file filename with fully qualified ([absolute](https://www.computerhope.com/issues/ch001708.htm)) path. Use quotes if there are spaces in the path.|
87+
|`namewidth`|Integer|`14`|Minimum computer name width. Longer names are _**not**_ truncated. Shorter names are padded with spaces.|
88+
|`no-buildinfo`|Boolean|`false`|Version and build info will_**not**_ be included in the log entry.|
89+
|`no-text`|Boolean|`false`|The "was rebooted on" text will _**not**_ be included in the log entry.|
90+
|`quiet`|Boolean|`false`|Quiet operation. Do _**not**_ print non-error messages to the console.|
91+
|`timeformat`|String|`12Hour`|Date/Time format. Use `12Hour` for 12 hour, `24Hour` for 24 hour or most of the Go pre-defined formats. _DateOnly and TimeOnly are _**not**_ included_. See https://pkg.go.dev/time#pkg-constants for details. |
9292

9393

9494
### Configuration file
@@ -97,7 +97,7 @@ If used, the configuration file _**must**_ be named `config.yaml` and _**must**_
9797
#### Example configuration file:
9898
```yaml
9999
# Name of the log file
100-
LogFile: "./bootlogger.log"
100+
LogFile: "D:\Logs\bootlogger.test.log"
101101

102102
# Minimum width of the computer name field in the log
103103
NameWidth: 12
@@ -137,19 +137,19 @@ Note that shorthand flags must be **lower case**.
137137

138138
#### Command-line examples:
139139
```powershell
140-
bootlog.exe --timeformat 12hour
140+
bootlogger.exe --timeformat 12hour
141141
Desktop-Computer was rebooted on 2025-06-19 7:43:19 AM [Windows 11 Pro build 26100.4061]
142142
143-
bootlog.exe -t=24h
143+
bootlogger.exe -t=24h
144144
Desktop-Computer was rebooted on 2025-06-19 07:43:19 [Windows 11 Pro build 26100.4061]
145145
146-
bootlog.exe --timeformat RFC822 --no-buildinfo
146+
bootlogger.exe --timeformat RFC822 --no-buildinfo
147147
Desktop-Computer was rebooted on 19 Jun 25 07:43 CDT
148148
149-
bootlog.exe --no-text
149+
bootlogger.exe --no-text
150150
Desktop-Computer 2025-06-19 7:43:19 AM [Windows 11 Pro build 26100.4061]
151151
152-
bootlog.exe --logfile d:\logs\bootlog.txt -q
152+
bootlogger.exe --logfile d:\logs\bootlog.txt -q
153153
#The entry will be made in the log file but nothing will be written to the console.
154154
155155
bootlogger.exe --dryrun

0 commit comments

Comments
 (0)