You must create a file remote-logger.json in your home directory.
touch ~/remote-logger.jsonEdit this file by your prefered editor (vim, nano, vscode, sublime etc).
If you connect to an server which is already in your ~/.ssh/config you can simply use:
{
"host": "192.168.1.2",
"port": 22,
"username": "your-login"
}If you have to deal with multiple SSH connections you should use an key pair for every host you connect to. It is also a good idea to protect your keys with a passphrase. You should consider use a ssh-agent. To enable ssh-agent usage, activate it with agent = true parameter.
{
"host": "192.168.1.2",
"port": 22,
"username": "your-login",
"agent": true
}If you specified an different ssh key than .id_rsa you can simply set it by:
{
"host": "192.168.1.2",
"port": 22,
"username": "your-login",
"privateKey": "/full/path/to/your/private/key"
}If your key is password protected, set your passphrase via:
{
"host": "192.168.1.2",
"port": 22,
"username": "your-login",
"privateKey": "/full/path/to/your/private/key",
"passphrase": "<your passphrase>"
}Warning: remote-logger.json is unencrypted, everyone with read access to this file can read your passphrase!
Warning: remote-logger.json is unencrypted, everyone with read access to this file can read your passphrase!
{
"host": "192.168.1.2",
"port": 22,
"username": "your-login",
"password": "your-password"
}You can define, how many log entries are displayed. If you don't set this value, as default 100 is used.
{
"maxLogEntries": 50,
}If you want to log the logger, you can enable debug mode with "debug": true. Be aware, windows will show strange behaviour if you enable logging.
{
"debug": true,
}curl -X POST -H "Content-Type: application/json" -d '{"level": "debug", "message": "Hello Debug", "type": "text", "context": {"email": "[email protected]"}}' http://localhost:29980
curl -X POST -H "Content-Type: application/json" -d '{"level": "debug", "message": "Debug SQL", "type": "sql", "statement": "select * from foo where bar > 42;", "context": {}}' http://localhost:29980