Skip to content

Commit

Permalink
changed: log level support, env var LOGLEVEL (debug, *info, warn, err…
Browse files Browse the repository at this point in the history
…or, none)
  • Loading branch information
diva-exchange committed Jul 26, 2022
1 parent cf25d1a commit aadb50e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# for this file format description,
# see https://github.com/olivierlacan/keep-a-changelog

## [2.42.1-1] - 2022-07-26
### Added
- log level support, env var LOGLEVEL (debug, *info, warn, error, none)

## [2.42.1] - 2022-05-25
### Changed
- i2pd version 2.42.1
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ Set BANDWIDTH to control or limit the bandwidth used by the router. Use "L" (32K

Set ENABLE_UPNP to 1 (true) or 0 (false) to enable UPNP. Defaults to 0 (false).

Set LOGLEVEL to the desired logging level: debug, info, warn, error or none. Defaults to info.

Some examples on how to use environment variables:

`docker run --env ENABLE_TUNNELS=1 -p 127.0.0.1:7070:7070 -d --name i2pd divax/i2p:latest`

`docker run --env ENABLE_SOCKSPROXY=1 --env ENABLE_SAM=1 --env ENABLE_FLOODFILL=1 -p 127.0.0.1:7070:7070 -p 127.0.0.1:4445:4445 -p 127.0.0.1:7656:7656 -d --name i2pd divax/i2p:latest`

`docker run --env BANDWIDTH=X -p 127.0.0.1:7070:7070 -p 127.0.0.1:4445:4445 -d --name i2pd divax/i2p:latest`
`docker run --env LOGLEVEL=error --env BANDWIDTH=X -p 127.0.0.1:7070:7070 -p 127.0.0.1:4445:4445 -d --name i2pd divax/i2p:latest`

### Advanced: Tunnel Configuration
Tunnels are exposing specific services to the I2P network. Like a web server, an application or a blockchain.
Expand Down
2 changes: 1 addition & 1 deletion conf/i2pd.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ log = stdout
# logfile = /home/i2pd/log/i2pd.log
## Log messages above this level (debug, *info, warn, error, none)
## If you set it to none, logging will be disabled
loglevel = info
loglevel = $LOGLEVEL
## Write full CLF-formatted date and time to log (default: write only time)
logclftime = true

Expand Down
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,15 @@ else
TUNNELS_DIR=/home/i2pd/tunnels.null
fi

LOGLEVEL=${LOGLEVEL:-info}

# create a copy of the i2pd config file
cp /home/i2pd/conf/i2pd.org.conf /home/i2pd/conf/i2pd.conf
# replace variables in the i2pd config files
sed -i 's!\$IP_CONTAINER!'"${IP_CONTAINER}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$IP_BRIDGE!'"${IP_BRIDGE}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$TUNNELS_DIR!'"${TUNNELS_DIR}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$LOGLEVEL!'"${LOGLEVEL}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$ENABLE_HTTPPROXY!'"${ENABLE_HTTPPROXY}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$PORT_HTTPPROXY!'"${PORT_HTTPPROXY}"'!g' /home/i2pd/conf/i2pd.conf
sed -i 's!\$ENABLE_SOCKSPROXY!'"${ENABLE_SOCKSPROXY}"'!g' /home/i2pd/conf/i2pd.conf
Expand Down

0 comments on commit aadb50e

Please sign in to comment.