Search in sources :

Example 6 with ServerCollectLog

use of com.ibeiliao.deployment.common.vo.ServerCollectLog in project Corgi by kevinYin.

the class LogService method collectDeployLog.

/**
 * 收集服务器发布执行的shell 日志
 * @param id
 * @param logType
 * @param content
 * @return
 */
public boolean collectDeployLog(int id, short logType, String content) {
    try {
        ServerCollectLog serverShellLog = new ServerCollectLog(id, logType, content);
        if (logType == LogType.SERVER_DEPLOY_LOG.getType()) {
            collectServerDeployLog(serverShellLog);
        }
        redis.rpush(RedisLogKey.getServerDeploymentKey(), JSONObject.toJSONString(serverShellLog));
        return true;
    } catch (Exception e) {
        logger.error("收集日志失败 | msg:{}", e.getMessage(), e);
        return false;
    }
}
Also used : ServerCollectLog(com.ibeiliao.deployment.common.vo.ServerCollectLog)

Aggregations

ServerCollectLog (com.ibeiliao.deployment.common.vo.ServerCollectLog)6 ServerDeployHistoryPO (com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO)1 ServerDeployLogPO (com.ibeiliao.deployment.admin.po.deploy.ServerDeployLogPO)1 ShellLogResponseMessage (com.ibeiliao.deployment.admin.websocket.request.ShellLogResponseMessage)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TextMessage (org.springframework.web.socket.TextMessage)1 WebSocketSession (org.springframework.web.socket.WebSocketSession)1 JedisPubSub (redis.clients.jedis.JedisPubSub)1