Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-19315] Replace old Logger with mlog.Logger (mattermost package) #130

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cc3de47
Updated logging in Android and Apple notification servers
willypuzzle Nov 27, 2024
a36f118
Refactored logging for better readability
willypuzzle Nov 28, 2024
3c4e226
Updated server error handling
willypuzzle Nov 28, 2024
5588dba
Updated logger type in server modules
willypuzzle Nov 28, 2024
4edb970
Updated push proxy configuration
willypuzzle Dec 3, 2024
7cf7782
Refactor config loading in push proxy
willypuzzle Dec 3, 2024
e12e722
Enhanced logger initialization and configuration
willypuzzle Dec 3, 2024
8e38a57
Updated Go version and dependencies
willypuzzle Dec 3, 2024
bd90d26
Refactored logging configuration setup
willypuzzle Dec 3, 2024
1cdae1e
Revert "Updated Go version and dependencies"
willypuzzle Dec 4, 2024
e5d88d7
Updated Go version and dependencies
willypuzzle Dec 4, 2024
c8429cf
Update Docker image versions
willypuzzle Dec 4, 2024
3c9f4b3
Updated logger initialization in tests
willypuzzle Dec 4, 2024
01577ed
Improved error handling and logging configuration
willypuzzle Dec 4, 2024
7d5332d
Added logging tests
willypuzzle Dec 4, 2024
ffc8c2c
Updated logging configuration in JSON
willypuzzle Dec 4, 2024
2e20f76
Added new logging configuration file
willypuzzle Dec 4, 2024
2a198dc
Refactored logger initialization and configuration
willypuzzle Dec 4, 2024
4af221e
Updated Push Proxy to version 5.9.0
willypuzzle Dec 4, 2024
02a6b10
Updated README with CHANGELOG reference
willypuzzle Dec 4, 2024
a0546f8
Update server/logging.go test logic
willypuzzle Dec 5, 2024
ef2d621
Refactor logging configuration logic
willypuzzle Dec 5, 2024
63b3a3f
Refactored logging tests for better readability
willypuzzle Dec 5, 2024
44527f6
Updated dependencies in go.mod and go.sum
willypuzzle Dec 6, 2024
5557df2
Refactor logging tests and remove random string generation
willypuzzle Dec 6, 2024
0b850d3
Refactor logging configuration
willypuzzle Dec 10, 2024
35ffe15
Removed logging config file and updated logging settings
willypuzzle Dec 10, 2024
f2bbb79
Revert "Updated README with CHANGELOG reference"
willypuzzle Dec 10, 2024
28b6e24
Revert "Updated Push Proxy to version 5.9.0"
willypuzzle Dec 10, 2024
ea4f796
Enabled console logging
willypuzzle Dec 10, 2024
92a8c9d
Updated golangci-lint version in Docker image
willypuzzle Dec 10, 2024
ecdf0ae
Removed logging functionality
willypuzzle Dec 23, 2024
a52d219
Refactored import statements in multiple files
willypuzzle Dec 23, 2024
6cc7504
Refactored logging system
willypuzzle Dec 23, 2024
d78e5bd
Updated logging messages for notifications
willypuzzle Dec 23, 2024
b7356eb
Enhanced logging and timeout configuration
willypuzzle Dec 23, 2024
174fde7
Refactor logger initialization
willypuzzle Dec 23, 2024
26bfaee
fix more issues
agnivade Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Mattermost Push Proxy Changelog


## 5.9.0 Release
willypuzzle marked this conversation as resolved.
Show resolved Hide resolved
- Release Date: <to define>
- Compatible with all versions of Mattermost server and mobile

### Compatibility
- As of April 10, 2018, Google has deprecated the Google Cloud Messaging (GCM) service. The GCM server and client APIs are deprecated and will be removed as of April 11, 2019. You must [migrate GCM apps to Firebase Cloud Messaging (FCM)](https://developers.mattermost.com/contribute/mobile/push-notifications/migrate-gcm-fcm/), which inherits the reliable and scalable GCM infrastructure, plus many new features.

### Highlights
- Replaced old Logger system with [mlog.Logger](https://github.com/mattermost/mattermost/blob/master/server/public/shared/mlog/mlog.go).
- Deprecated type EnableConsoleLog, EnableFileLog, and LogFileLocation from the config and replaced it with [LoggingCfgFile and LoggingCfgJSON](https://docs.mattermost.com/manage/logging.html).
- Switched from go 1.21 to go 1.22.


## 5.8.1 Release
- Release Date: March 28, 2019
- Compatible with all versions of Mattermost server and mobile
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ ifneq ($(shell echo $(APP_VERSION) | egrep '^v([0-9]+\.){0,2}(\*|[0-9]+)'),)
endif

## Docker Images
DOCKER_IMAGE_GO ?= "golang:${GO_VERSION}@sha256:d83472f1ab5712a6b2b816dc811e46155e844ddc02f5f5952e72c6deedafed77"
DOCKER_IMAGE_GOLINT ?= "golangci/golangci-lint:v1.57.2@sha256:8f3a60a00a83bb7d599d2e028ac0c3573dc2b9ec0842590f1c2e59781c821da7"
DOCKER_IMAGE_GO ?= "golang:${GO_VERSION}@sha256:21edeab9ed48e9820f0b447cce6ce1900b3aa90ffce3c8b4de7fae5ac333de0c"
DOCKER_IMAGE_GOLINT ?= "golangci/golangci-lint:v1.62.2@sha256:0f3af3929517ed4afa1f1bcba4eae827296017720e08ecd5c68b9f0640bc310d"
willypuzzle marked this conversation as resolved.
Show resolved Hide resolved
DOCKER_IMAGE_DOCKERLINT ?= "hadolint/hadolint:v2.12.0"
DOCKER_IMAGE_COSIGN ?= "bitnami/cosign:1.8.0@sha256:8c2c61c546258fffff18b47bb82a65af6142007306b737129a7bd5429d53629a"
DOCKER_IMAGE_GH_CLI ?= "ghcr.io/supportpal/github-gh-cli:2.31.0@sha256:71371e36e62bd24ddd42d9e4c720a7e9954cb599475e24d1407af7190e2a5685"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ To trigger a release of Mattermost Push-Proxy, follow these steps:
make major
```
This will release a major change.

See the [CHANGELOG](CHANGELOG.md) for more information.
willypuzzle marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 24 additions & 0 deletions config/logging-cfg-file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
willypuzzle marked this conversation as resolved.
Show resolved Hide resolved
"def": {
"type": "console",
"options": {
"out": "stdout"
},
"format": "plain",
"format_options": {
"delim": " ",
"min_level_len": 5,
"min_msg_len": 40,
"enable_color": true,
"enable_caller": true
},
"levels": [
{"id": 5, "name": "debug"},
{"id": 4, "name": "info", "color": 36},
{"id": 3, "name": "warn"},
{"id": 2, "name": "error", "color": 31},
{"id": 1, "name": "fatal", "stacktrace": true},
{"id": 0, "name": "panic", "stacktrace": true}
]
}
}
5 changes: 2 additions & 3 deletions config/mattermost-push-proxy.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"ServiceFileLocation":""
}
],
"EnableConsoleLog": true,
"EnableFileLog": false,
"LogFileLocation": ""
"LoggingCfgFile": "",
"LoggingCfgJSON": ""
willypuzzle marked this conversation as resolved.
Show resolved Hide resolved
}
32 changes: 19 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
module github.com/mattermost/mattermost-push-proxy

go 1.21
go 1.22

toolchain go1.21.9
toolchain go1.22.10

require (
firebase.google.com/go/v4 v4.14.0
github.com/gorilla/handlers v1.5.2
github.com/gorilla/mux v1.8.1
github.com/kyokomi/emoji v2.2.4+incompatible
github.com/mattermost/mattermost/server/public v0.1.9
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/common v0.53.0
github.com/sideshow/apns2 v0.23.0
github.com/stretchr/testify v1.9.0
golang.org/x/net v0.24.0
golang.org/x/oauth2 v0.19.0
golang.org/x/net v0.27.0
golang.org/x/oauth2 v0.21.0
google.golang.org/api v0.176.1
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/throttled/throttled.v1 v1.0.0
Expand All @@ -33,8 +34,9 @@ require (
github.com/PuerkitoBio/boom v0.0.0-20140219125548-fecdef1c97ca // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/garyburd/redigo v1.6.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -46,28 +48,32 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattermost/logr/v2 v2.0.21 // indirect
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.14.0 // indirect
github.com/rakyll/pb v0.0.0-20160123035540-8d46b8b097ef // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/wiggin77/merror v1.0.5 // indirect
github.com/wiggin77/srslog v1.0.1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect
go.opentelemetry.io/otel v1.26.0 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine/v2 v2.0.6 // indirect
google.golang.org/genproto v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/grpc v1.63.2 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading