https://github.com/appscode-cloud/nats-logger
https://github.com/appscode-cloud/nats-logger
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/appscode-cloud/nats-logger
- Owner: appscode-cloud
- License: other
- Created: 2022-12-23T10:00:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-08-15T04:55:54.000Z (10 months ago)
- Last Synced: 2025-08-15T06:26:19.189Z (10 months ago)
- Language: Go
- Size: 3.21 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ssh-exec-demo
## GIST
- https://gist.github.com/tamalsaha/8ad260a679bcd65d21d52fa709171af3
## Full Demo
1. Starts a new server using a Stackscript
2. Stackscript logs to a file
3. Stackscript log is passed back to the user via nats
4. Stackscript status and log are copied via scp
```
> go run scp-demo/*.go
```
## Step 1: Listen for Logs
```
nats -s this-is-nats.appscode.ninja --user=$THIS_IS_NATS_USERNAME --password=$THIS_IS_NATS_PASSWORD sub stackscript-log
```
## Step 2: Run script
```
./script.sh
```
## Send Logs via NATS (used in stackscript)
```
SHIPPER_FILE=/tmp/stackscript.log \
SHIPPER_SUBJECT=stackscript-log \
go run nats-logger/main.go
```
## NATS example
```
nats -s this-is-nats.appscode.ninja --user=$THIS_IS_NATS_USERNAME --password=$THIS_IS_NATS_PASSWORD sub stackscript-log
nats -s this-is-nats.appscode.ninja --user=$THIS_IS_NATS_USERNAME --password=$THIS_IS_NATS_PASSWORD pub hello tamal
```