fix: adding comprehensive logs for live server (#7947)
* fix: adding comprehensive logs * fix: document controller naming convention * fix: axios interception logger
This commit is contained in:
parent
9ce6179421
commit
8cd29c5009
10 changed files with 112 additions and 72 deletions
|
|
@ -35,15 +35,15 @@ export class Server {
|
|||
public async initialize(): Promise<void> {
|
||||
try {
|
||||
await redisManager.initialize();
|
||||
logger.info("Redis setup completed");
|
||||
logger.info("SERVER: Redis setup completed");
|
||||
const manager = HocusPocusServerManager.getInstance();
|
||||
this.hocuspocusServer = await manager.initialize();
|
||||
logger.info("HocusPocus setup completed");
|
||||
logger.info("SERVER: HocusPocus setup completed");
|
||||
|
||||
this.setupRoutes(this.hocuspocusServer);
|
||||
this.setupNotFoundHandler();
|
||||
} catch (error) {
|
||||
logger.error("Failed to initialize live server dependencies:", error);
|
||||
logger.error("SERVER: Failed to initialize live server dependencies:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,10 +89,10 @@ export class Server {
|
|||
public listen() {
|
||||
this.httpServer = this.app
|
||||
.listen(this.app.get("port"), () => {
|
||||
logger.info(`Plane Live server has started at port ${this.app.get("port")}`);
|
||||
logger.info(`SERVER: Express server has started at port ${this.app.get("port")}`);
|
||||
})
|
||||
.on("error", (err) => {
|
||||
logger.error("Failed to start server:", err);
|
||||
logger.error("SERVER: Failed to start server:", err);
|
||||
throw err;
|
||||
});
|
||||
}
|
||||
|
|
@ -100,11 +100,11 @@ export class Server {
|
|||
public async destroy() {
|
||||
if (this.hocuspocusServer) {
|
||||
this.hocuspocusServer.closeConnections();
|
||||
logger.info("HocusPocus connections closed gracefully.");
|
||||
logger.info("SERVER: HocusPocus connections closed gracefully.");
|
||||
}
|
||||
|
||||
await redisManager.disconnect();
|
||||
logger.info("Redis connection closed gracefully.");
|
||||
logger.info("SERVER: Redis connection closed gracefully.");
|
||||
|
||||
if (this.httpServer) {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
|
|
@ -112,7 +112,7 @@ export class Server {
|
|||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
logger.info("Express server closed gracefully.");
|
||||
logger.info("SERVER: Express server closed gracefully.");
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue