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"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
||||||
|
"github.com/mattermost/focalboard/server/model"
|
||||||
|
|
||||||
"github.com/mattermost/mattermost-server/v6/app"
|
"github.com/mattermost/mattermost-server/v6/app"
|
||||||
mm_model "github.com/mattermost/mattermost-server/v6/model"
|
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)
|
return fmt.Errorf("failed to create Boards service: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.LogServerInfo(bp.logger)
|
||||||
|
|
||||||
bp.boardsApp = boardsApp
|
bp.boardsApp = boardsApp
|
||||||
if err := bp.boardsApp.Start(); err != nil {
|
if err := bp.boardsApp.Start(); err != nil {
|
||||||
return fmt.Errorf("failed to start Boards service: %w", err)
|
return fmt.Errorf("failed to start Boards service: %w", err)
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
"github.com/mattermost/focalboard/mattermost-plugin/server/boards"
|
||||||
|
"github.com/mattermost/focalboard/server/model"
|
||||||
|
|
||||||
pluginapi "github.com/mattermost/mattermost-plugin-api"
|
pluginapi "github.com/mattermost/mattermost-plugin-api"
|
||||||
|
|
||||||
@ -52,6 +53,8 @@ func (p *Plugin) OnActivate() error {
|
|||||||
return fmt.Errorf("cannot activate plugin: %w", err)
|
return fmt.Errorf("cannot activate plugin: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.LogServerInfo(logger)
|
||||||
|
|
||||||
p.boardsApp = boardsApp
|
p.boardsApp = boardsApp
|
||||||
return p.boardsApp.Start()
|
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() {
|
func main() {
|
||||||
// Command line args
|
// Command line args
|
||||||
pMonitorPid := flag.Int("monitorpid", -1, "a process ID")
|
pMonitorPid := flag.Int("monitorpid", -1, "a process ID")
|
||||||
@ -101,7 +91,7 @@ func main() {
|
|||||||
defer restore()
|
defer restore()
|
||||||
}
|
}
|
||||||
|
|
||||||
logInfo(logger)
|
model.LogServerInfo(logger)
|
||||||
|
|
||||||
singleUser := false
|
singleUser := false
|
||||||
if pSingleUser != nil {
|
if pSingleUser != nil {
|
||||||
@ -214,7 +204,7 @@ func startServer(webPath string, filesPath string, port int, singleUserToken, db
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
logInfo(logger)
|
model.LogServerInfo(logger)
|
||||||
|
|
||||||
if len(filesPath) > 0 {
|
if len(filesPath) > 0 {
|
||||||
config.FilesPath = filesPath
|
config.FilesPath = filesPath
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||||
|
)
|
||||||
|
|
||||||
// This is a list of all the current versions including any patches.
|
// This is a list of all the current versions including any patches.
|
||||||
// It should be maintained in chronological order with most current
|
// It should be maintained in chronological order with most current
|
||||||
// release at the front of the list.
|
// release at the front of the list.
|
||||||
@ -41,3 +45,14 @@ var (
|
|||||||
BuildHash string
|
BuildHash string
|
||||||
Edition 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