Commit 3bc5d8da authored by 智勇's avatar 智勇

update detail Object

parent 762f254b
...@@ -485,10 +485,18 @@ exports.restart_system = async function () { ...@@ -485,10 +485,18 @@ exports.restart_system = async function () {
} }
try { try {
this.logger.info( this.logger.info(
"namespace:", this.request.body.namespace, {
" microservice_name:", this.request.body.system_name, namespace: this.request.body.namespace,
" active:", "restart_microservice", active: "restart_microservice",
" user:", this.user); microservice_name: this.request.body.system_name,
user: `${this.user.name}`,
user_mail: `${this.user.mail}`,
}
// "namespace:", this.request.body.namespace,
// " microservice_name:", this.request.body.system_name,
// " active:", "restart_microservice",
// " user:", this.user);
)
} catch (error) { } catch (error) {
console.log(this.logger) console.log(this.logger)
} }
...@@ -511,10 +519,18 @@ exports.delete_system = async function () { ...@@ -511,10 +519,18 @@ exports.delete_system = async function () {
} }
try { try {
this.logger.info( this.logger.info(
"namespace:", this.request.body.namespace, {
" name:", this.request.body.system_name, namespace: this.request.body.namespace,
" active:", "delete_microservice", active: "delete_microservice",
" user:", this.user); microservice_name: this.request.body.system_name,
user: `${this.user.name}`,
user_mail: `${this.user.mail}`,
}
// "namespace:", this.request.body.namespace,
// " name:", this.request.body.system_name,
// " active:", "delete_microservice",
// " user:", this.user
);
} catch (error) { } catch (error) {
} }
...@@ -766,9 +782,17 @@ exports.create_system = async function () { ...@@ -766,9 +782,17 @@ exports.create_system = async function () {
this.body = res; this.body = res;
try { try {
this.logger.info( this.logger.info(
"namespace:", temp, {
" active:", "create_microservice", namespace: this.request.body.namespace,
" user:", this.user); active: "create_microservice",
microservice_name: this.request.body.name,
// user: `${this.user.name}`,
// user_mail: `${this.user.mail}`,
}
// "namespace:", temp,
// " active:", "create_microservice",
// " user:", this.user
);
} catch (error) { } catch (error) {
} }
...@@ -791,9 +815,9 @@ exports.update_system = async function () { ...@@ -791,9 +815,9 @@ exports.update_system = async function () {
try { try {
this.logger.info( this.logger.info(
{ {
namespace: req.namespace, namespace: this.request.body.namespace,
active: "update_microservice", active: "update_microservice",
microservice_name: req.namespace, microservice_name: this.request.body.name,
user: `${this.user.name}`, user: `${this.user.name}`,
user_mail: `${this.user.mail}`, user_mail: `${this.user.mail}`,
detail: temp detail: temp
...@@ -803,7 +827,7 @@ exports.update_system = async function () { ...@@ -803,7 +827,7 @@ exports.update_system = async function () {
// " user:", this.user // " user:", this.user
); );
} catch (error) { } catch (error) {
console.log(error)
} }
return return
...@@ -930,6 +954,13 @@ exports.reload_mq = async function () { ...@@ -930,6 +954,13 @@ exports.reload_mq = async function () {
this.body = { code: "0000" }; this.body = { code: "0000" };
try { try {
this.logger.info( this.logger.info(
// {
// namespace: req.name_space,
// active: "reset_binlog",
// microservice_name: "",
// user: `${this.user.name}`,
// user_mail: `${this.user.mail}`,
// }
"namespace:", this.request.body.host, "namespace:", this.request.body.host,
" active:", "reload_mq", " active:", "reload_mq",
" user:", this.user " user:", this.user
......
...@@ -28,7 +28,7 @@ exports.get = async function () { ...@@ -28,7 +28,7 @@ exports.get = async function () {
exports.get_log = async function () { exports.get_log = async function () {
await this.bindDefault(); await this.bindDefault();
let item = await this.mongo("statisticslog").getLog(this.request.body); let item = await this.mongo("statisticslog").getLog(this.request.body, { create_time: -1 });
this.body = item this.body = item
return return
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ var StatisticsSchema = new Schema({ ...@@ -23,7 +23,7 @@ var StatisticsSchema = new Schema({
microservice_name: String, microservice_name: String,
user: String, user: String,
user_mail: String, user_mail: String,
detail: String, detail: Object,
create_time: Date create_time: Date
}); });
...@@ -40,7 +40,7 @@ var logger = { ...@@ -40,7 +40,7 @@ var logger = {
microservice_name: "", microservice_name: "",
user: "", user: "",
user_mail: "", user_mail: "",
detail: "", detail: undefined,
create_time: new Date() create_time: new Date()
} }
if (typeof args[0] === "string") { if (typeof args[0] === "string") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment