Skip to content

Commit

Permalink
Adding syslog support for VCH (#5021)
Browse files Browse the repository at this point in the history
* Adding syslog package
* Adding syslog-address option to vic-machine
* Adding retry around connecting to syslog server
* Adding pullapprove for pkg/log
* Adding test for syslog
* Removing TEST_BUILD_IMAGE
  • Loading branch information
hmahmood authored May 12, 2017
1 parent 0a2ea8c commit 83c7290
Show file tree
Hide file tree
Showing 30 changed files with 1,259 additions and 97 deletions.
11 changes: 7 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pipeline:
recursive: false

wait-for-build:
image: ${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.30}
image: gcr.io/eminent-nation-87317/vic-integration-test:1.31
pull: true
environment:
BIN: bin
Expand All @@ -31,7 +31,7 @@ pipeline:
- tests/wait_until_previous_builds_complete.sh

vic-engine:
image: ${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.30}
image: gcr.io/eminent-nation-87317/vic-integration-test:1.31
pull: true
environment:
BIN: bin
Expand All @@ -57,7 +57,7 @@ pipeline:
status: success

vic-integration-test-on-pr:
image: ${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.30}
image: gcr.io/eminent-nation-87317/vic-integration-test:1.31
pull: true
privileged: true
environment:
Expand All @@ -82,6 +82,9 @@ pipeline:
GS_CLIENT_EMAIL: ${GS_CLIENT_EMAIL}
GS_PRIVATE_KEY: ${GS_PRIVATE_KEY}
DOMAIN: ${CI_DOMAIN}
SYSLOG_SERVER: ${SYSLOG_SERVER}
SYSLOG_USER: ${SYSLOG_USER}
SYSLOG_PASSWD: ${SYSLOG_PASSWD}
commands:
- make mark
- tests/integration-test.sh
Expand All @@ -90,7 +93,7 @@ pipeline:
status: success

vic-ui:
image: ${TEST_BUILD_IMAGE=gcr.io/eminent-nation-87317/vic-integration-test:1.30}
image: gcr.io/eminent-nation-87317/vic-integration-test:1.31
pull: true
environment:
BIN: bin
Expand Down
2 changes: 1 addition & 1 deletion .drone.yml.sig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.IyBBZnRlciBhbnkgY2hhbmdlIHRvIHRoaXMgZmlsZSB5b3UgTVVTVCByZS1zaWduIGFuZCBjaGVja2luIHRoZSAuZHJvbmUueW1sLnNpZwojIFdoZW4geW91IGFyZSByZWFkeSB0byBzdWJtaXQgYSBwdWxsIHJlcXVlc3QsIHlvdSBtdXN0IHJlZ2VuZXJhdGUgLmRyb25lLnltbC5zaWcgZm9yIHRoZSB2bXdhcmUvdmljIHJlcG86CiMgJCBleHBvcnQgRFJPTkVfU0VSVkVSPWh0dHBzOi8vY2kudmNuYS5pbwojICQgZXhwb3J0IERST05FX1RPS0VOPTx0b2tlbj4KIyAkIGRyb25lIHNpZ24gdm13YXJlL3ZpYwojIFRoZSBzZWNyZXRzIGZpbGUgaXMgaW4gb3VyIGxvY2FsIGdpdCByZXBvLiAgQXNrIG1oYWdlbiBmb3IgYWNjZXNzLgoKLS0tCndvcmtzcGFjZToKICBiYXNlOiAvZ28KICBwYXRoOiBzcmMvZ2l0aHViLmNvbS92bXdhcmUvdmljCgpwaXBlbGluZToKICBjbG9uZToKICAgIGltYWdlOiBwbHVnaW5zL2dpdAogICAgdGFnczogdHJ1ZQogICAgIyBkb250IGNsb25lIHN1Ym1vZHVsZXMKICAgIHJlY3Vyc2l2ZTogZmFsc2UKCiAgd2FpdC1mb3ItYnVpbGQ6CiAgICBpbWFnZTogJHtURVNUX0JVSUxEX0lNQUdFPWdjci5pby9lbWluZW50LW5hdGlvbi04NzMxNy92aWMtaW50ZWdyYXRpb24tdGVzdDoxLjMwfQogICAgcHVsbDogdHJ1ZQogICAgZW52aXJvbm1lbnQ6CiAgICAgIEJJTjogYmluCiAgICAgIEdPUEFUSDogL2dvCiAgICAgIFNIRUxMOiAvYmluL2Jhc2gKICAgICAgVEVTVF9VUkxfQVJSQVk6ICR7VEVTVF9VUkxfQVJSQVl9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AgICAgcmVwbzogdm13YXJlL3ZpYwogICAgICBldmVudDogWyBwdXNoLCB0YWcgXQogICAgICBicmFuY2g6IFsgcmVmcy90YWdzLyogXQogICAgICBzdGF0dXM6IHN1Y2Nlc3MKCiAgcmVwb3J0LWNvdmVyYWdlOgogICAgaW1hZ2U6IHBsdWdpbnMvY292ZXJhZ2UKICAgIHNlcnZlcjogaHR0cHM6Ly9jb3ZlcmFnZS52bXdhcmUucnVuCiAgICBwYXR0ZXJuOiAuY292ZXIvY292ZXIub3V0CiAgICB3aGVuOgogICAgICBicmFuY2g6IFsgbWFzdGVyLCByZWxlYXNlcy8qLCByZWZzL3RhZ3MvKiBdCiAgICAgIHJlcG86IHZtd2FyZS92aWMKICAgICAgc3RhdHVzOiBzdWNjZXNzCg.rnZWa3eJq8Q_DOR2BWo-Z9YqERGKz0Nbk-jVQdliou8
9 changes: 9 additions & 0 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ groups:
include:
- "tests/nightly/*"

log:
users:
- hmahmood
- fdawg4l
conditions:
files:
include:
- "pkg/log/*"

vcsim:
users:
- dougm
Expand Down
32 changes: 26 additions & 6 deletions cmd/docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net"
"os"

"github.com/RackSec/srslog"
log "github.com/Sirupsen/logrus"
apiserver "github.com/docker/docker/api/server"
"github.com/docker/docker/api/server/middleware"
Expand All @@ -45,6 +46,7 @@ import (
"github.com/vmware/vic/lib/config"
"github.com/vmware/vic/lib/pprof"
viclog "github.com/vmware/vic/pkg/log"
"github.com/vmware/vic/pkg/log/syslog"
"github.com/vmware/vic/pkg/trace"
"github.com/vmware/vic/pkg/version"
"github.com/vmware/vic/pkg/vsphere/extraconfig"
Expand All @@ -70,8 +72,8 @@ var (
)

func init() {
log.SetFormatter(viclog.NewTextFormatter())
trace.Logger.Level = log.DebugLevel
trace.Logger = log.StandardLogger()

pprof.StartPprof("docker personality", pprof.DockerPort)

flag.Usage = Usage
Expand All @@ -98,6 +100,10 @@ func main() {
os.Exit(1)
}

if err := initLogging(); err != nil {
log.Fatalf("failed to initialize logging: %s", err)
}

if err := vicbackends.Init(*cli.portLayerAddr, productName, &vchConfig, vchConfig.InsecureRegistries); err != nil {
log.Fatalf("failed to initialize backend: %s", err)
}
Expand Down Expand Up @@ -130,16 +136,30 @@ func handleFlags() bool {
}
extraconfig.Decode(src, &vchConfig)

if *cli.debug || vchConfig.Diagnostics.DebugLevel > 0 {
log.SetLevel(log.DebugLevel)
}

*cli.portLayerAddr = fmt.Sprintf("%s:%d", *cli.portLayerAddr, *cli.portLayerPort)
cli.proto = "tcp"

return true
}

func initLogging() error {
logcfg := viclog.NewLoggingConfig()
if *cli.debug || vchConfig.Diagnostics.DebugLevel > 0 {
logcfg.Level = log.DebugLevel
}

if vchConfig.Diagnostics.SysLogConfig != nil {
logcfg.Syslog = &syslog.SyslogConfig{
Network: vchConfig.Diagnostics.SysLogConfig.Network,
RAddr: vchConfig.Diagnostics.SysLogConfig.RAddr,
Formatter: syslog.RFC3164,
Priority: srslog.LOG_INFO | srslog.LOG_DAEMON,
}
}

return viclog.Init(logcfg)
}

func loadCAPool() *x509.CertPool {
// If we should verify the server, we need to load a trusted ca
pool := x509.NewCertPool()
Expand Down
33 changes: 30 additions & 3 deletions cmd/port-layer-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,25 @@
package main

import (
"net/url"
"os"
"os/signal"
"syscall"

"github.com/RackSec/srslog"
log "github.com/Sirupsen/logrus"
"github.com/go-openapi/loads"
"github.com/jessevdk/go-flags"

"github.com/vmware/vic/lib/apiservers/portlayer/restapi"
"github.com/vmware/vic/lib/apiservers/portlayer/restapi/operations"
ploptions "github.com/vmware/vic/lib/apiservers/portlayer/restapi/options"
"github.com/vmware/vic/lib/dns"
"github.com/vmware/vic/lib/pprof"
"github.com/vmware/vic/lib/vspc"
viclog "github.com/vmware/vic/pkg/log"
"github.com/vmware/vic/pkg/log/syslog"
"github.com/vmware/vic/pkg/trace"
)

var (
Expand All @@ -38,7 +43,9 @@ var (
)

func init() {
log.SetFormatter(viclog.NewTextFormatter())
trace.Logger = log.StandardLogger()

pprof.StartPprof("portlayer server", pprof.PortlayerPort)

swaggerSpec, err := loads.Analyzed(restapi.SwaggerJSON, "")
if err != nil {
Expand All @@ -60,10 +67,10 @@ func init() {
log.Fatalln(err)
}
}

}

func main() {

if _, err := parser.Parse(); err != nil {
if err := err.(*flags.Error); err != nil && err.Type == flags.ErrHelp {
os.Exit(0)
Expand All @@ -72,7 +79,27 @@ func main() {
os.Exit(1)
}

pprof.StartPprof("portlayer server", pprof.PortlayerPort)
logcfg := viclog.NewLoggingConfig()
if ploptions.PortLayerOptions.Debug {
logcfg.Level = log.DebugLevel
}

if ploptions.PortLayerOptions.SyslogAddr != nil {
u, err := url.Parse(*ploptions.PortLayerOptions.SyslogAddr)
if err != nil {
log.Fatalln(err)
}

logcfg.Syslog = &syslog.SyslogConfig{
Network: u.Scheme,
RAddr: u.Host,
Priority: srslog.LOG_INFO | srslog.LOG_DAEMON,
Formatter: syslog.RFC3164,
}
}

log.Infof("%+v", *logcfg)
viclog.Init(logcfg)

server.ConfigureAPI()

Expand Down
Binary file added cmd/tether/tether.test
Binary file not shown.
Loading

0 comments on commit 83c7290

Please sign in to comment.