Skip to content

Commit

Permalink
Add FWd logging docs (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwest authored Feb 3, 2020
1 parent 4927677 commit dcef0c2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,43 @@ npm install (path to `filewatcherd-(version).tar.gz` from step A)

Restart VS Code. Then, hit F5 to launch the debugger. It should build, compile, and start the Codewind VS Code extension. See [DEVELOPING.md](https://github.com/eclipse/codewind-vscode/blob/master/DEVELOPING.md) for additional information on launching a VS Code extension.


# How to view the Codewind Filewatchers logs

The filewatcher daemons automatically log filewatcher-specific log statements to a codewind-specific directory on the file system. At most the last 24MB of log files will be retained (rolling logs), and any existing log files are deleted on IDE startup.


### Locations of filewatcher log file(s), on the file system:

- When running in Codewind Eclipse: `(eclipse workspace)/.metadata`
- When running in Codewind VSCode:
- In VSCode, `Help` > `Toggle Developer Tools` > `Console`
- Then in the Filter box, enter `Logger initialized at`. For example: `Logger.js.setLogFilePath():62]: Logger initialized at c:\Users\JONATHANWest\AppData\Roaming\Code\logs\20190624T145813\exthost3\IBM.codewind\codewind.log`
- Open the directory containing `codewind.log`, and look for `filewatcherd-(...).log`
- When running standalone: `(user home dir)/.codewind`


### Log filename, in above directory:
- `filewatcherd-(#).log` (there should exist at least one, and at most two, log files; the log file with the larger `#` is the most recent.


### How to switch a filewatcher to the more verbose 'DEBUG' log level

Filewatchers default to an `INFO` log level. If you wish to see (or are asked to enable) the more verbose `DEBUG` log level, do as follows.

#### Steps:
1. Close VSCode and/or Eclipse, to ensure the existing filewatcher is stopped.
2. Set the following [system environment variable](https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them):
- `filewatcher_log_level` to `debug`
3. Open a new Command Prompt or Terminal and type:
- Windows: `echo %filewatcher_log_level%`
- Linux/MacOS: `echo $filewatcher_log_level`
- In both cases, you should see `debug`. If you do not, your system environment variable is not set correctly.
4. Start VSCode or Eclispe.

To verify the change has taken effect, open the `filewatcherd-(...).log` file and look for a line like this:
```
codewind-filewatcher logging to C:\Users\your-username\.codewind with log level DEBUG
```


0 comments on commit dcef0c2

Please sign in to comment.