Skip to content

Commit

Permalink
Document how to configure logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo authored May 2, 2017
1 parent 0663d11 commit 53f31a8
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,27 @@ saml_tools.sh

Bash script ``cget.sh`` retrieves and caches HTTP resources on disk. A previously cached resource is retrieved via HTTP Conditional GET [RFC 7232]. If the web server responds with HTTP 200 OK, the resource is cached and written to stdout. If the web server responds with 304 Not Modified, the cached resource is output instead.

To illustrate, define a couple of HTTP resources, a cache, and a log file:
First let's configure logging. For convenience, we will log directly to the terminal:

```Shell
$ export LOG_FILE=/dev/tty
```

The system defaults to INFO logging, which corresponds to ``LOG_LEVEL=3``. We make that explicit as follows:

```Shell
$ export LOG_LEVEL=3
```

Next we define a couple of HTTP resources and a cache:

```Shell
$ url1=http://md.incommon.org/InCommon/InCommon-metadata-preview.xml
$ url2=http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml
$ export CACHE_DIR=/tmp/http_cache
$ export LOG_FILE=/dev/tty
```

GET the first resource:
Now GET the first resource:

```Shell
$ $BIN_DIR/cget.sh $url1 > /dev/null
Expand Down

0 comments on commit 53f31a8

Please sign in to comment.