mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-20 20:45:00 +02:00
Print log server information on plugin run (#3711)
* Print log server information on plugin run * Add LogServerInfo to product mode * Fix log location
This commit is contained in:
parent
feb49eaf19
commit
831dff6192
@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
||||
"github.com/mattermost/focalboard/server/model"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/app"
|
||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
||||
@ -197,6 +198,8 @@ func (bp *boardsProduct) Start() error {
|
||||
return fmt.Errorf("failed to create Boards service: %w", err)
|
||||
}
|
||||
|
||||
model.LogServerInfo(bp.logger)
|
||||
|
||||
bp.boardsApp = boardsApp
|
||||
if err := bp.boardsApp.Start(); err != nil {
|
||||
return fmt.Errorf("failed to start Boards service: %w", err)
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
||||
"github.com/mattermost/focalboard/server/model"
|
||||
|
||||
pluginapi "github.com/mattermost/mattermost-plugin-api"
|
||||
|
||||
@ -52,6 +53,8 @@ func (p *Plugin) OnActivate() error {
|
||||
return fmt.Errorf("cannot activate plugin: %w", err)
|
||||
}
|
||||
|
||||
model.LogServerInfo(logger)
|
||||
|
||||
p.boardsApp = boardsApp
|
||||
return p.boardsApp.Start()
|
||||
}
|
||||
|
@ -53,16 +53,6 @@ func monitorPid(pid int, logger *mlog.Logger) {
|
||||
}()
|
||||
}
|
||||
|
||||
func logInfo(logger *mlog.Logger) {
|
||||
logger.Info("FocalBoard Server",
|
||||
mlog.String("version", model.CurrentVersion),
|
||||
mlog.String("edition", model.Edition),
|
||||
mlog.String("build_number", model.BuildNumber),
|
||||
mlog.String("build_date", model.BuildDate),
|
||||
mlog.String("build_hash", model.BuildHash),
|
||||
)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Command line args
|
||||
pMonitorPid := flag.Int("monitorpid", -1, "a process ID")
|
||||
@ -101,7 +91,7 @@ func main() {
|
||||
defer restore()
|
||||
}
|
||||
|
||||
logInfo(logger)
|
||||
model.LogServerInfo(logger)
|
||||
|
||||
singleUser := false
|
||||
if pSingleUser != nil {
|
||||
@ -214,7 +204,7 @@ func startServer(webPath string, filesPath string, port int, singleUserToken, db
|
||||
return
|
||||
}
|
||||
|
||||
logInfo(logger)
|
||||
model.LogServerInfo(logger)
|
||||
|
||||
if len(filesPath) > 0 {
|
||||
config.FilesPath = filesPath
|
||||
|
@ -1,5 +1,9 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
)
|
||||
|
||||
// This is a list of all the current versions including any patches.
|
||||
// It should be maintained in chronological order with most current
|
||||
// release at the front of the list.
|
||||
@ -41,3 +45,14 @@ var (
|
||||
BuildHash string
|
||||
Edition string
|
||||
)
|
||||
|
||||
// LogServerInfo logs information about the server instance.
|
||||
func LogServerInfo(logger mlog.LoggerIFace) {
|
||||
logger.Info("FocalBoard Server",
|
||||
mlog.String("version", CurrentVersion),
|
||||
mlog.String("edition", Edition),
|
||||
mlog.String("build_number", BuildNumber),
|
||||
mlog.String("build_date", BuildDate),
|
||||
mlog.String("build_hash", BuildHash),
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user