Skip to content

Commit

Permalink
Merge pull request #44 from rokett/dev
Browse files Browse the repository at this point in the history
Ensuring correct bind port is reflected in logging
  • Loading branch information
rokett authored Sep 14, 2020
2 parents 33174aa + cbd191d commit 83807bc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [4.5.1] - 2020-09-14
### Fixed
- #43 Ensuring that the logging reflects a custom bind port. Previously the logging was being setup in `init` which was before the flags are parsed.

## [4.5.0] - 2020-07-25
### Added
- #41 Added the following AAA metrics.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM golang:alpine as builder

ENV VERSION="4.4.0"
ENV VERSION="4.5.1"

WORKDIR $GOPATH/src/github.com/rokett
RUN \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: build

APP = Citrix-NetScaler-Exporter
VERSION = 4.5.0
VERSION = 4.5.1
BINARY-LINUX = ${APP}_${VERSION}_Linux_amd64

BUILD_VER = $(shell git rev-parse HEAD)
Expand Down
8 changes: 3 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ var (
nsInstance string
)

func init() {
logger = log.NewLogfmtLogger(os.Stdout)
logger = log.With(logger, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller, "app", app, "bind_port", *bindPort, "version", "v"+version, "build", build)
}

func main() {
flag.Parse()

Expand All @@ -49,6 +44,9 @@ func main() {
os.Exit(1)
}

logger = log.NewLogfmtLogger(os.Stdout)
logger = log.With(logger, "ts", log.DefaultTimestampUTC, "caller", log.DefaultCaller, "app", app, "bind_port", *bindPort, "version", "v"+version, "build", build)

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`<html>
<head><title>Citrix NetScaler Exporter</title></head>
Expand Down
2 changes: 1 addition & 1 deletion make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SETLOCAL

set APP=Citrix-NetScaler-Exporter
set VERSION=4.5.0
set VERSION=4.5.1
set BINARY-WINDOWS-X64=%APP%_%VERSION%_Windows_amd64.exe
set BINARY-LINUX=%APP%_%VERSION%_Linux_amd64

Expand Down

0 comments on commit 83807bc

Please sign in to comment.