mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
appflow: bug #1468 log does not show the component, only the log level
This commit is contained in:
1 parent
d038e43b32
commit
058d356104
2 files changed
+10
-7
No files matched your search
+9
-6
@@ -34,11 +34,14 @@ class Log
|
||||
@log_level = Logger::DEBUG
|
||||
|
||||
# Mon Feb 27 06:02:30 2012 [Clo] [E]: Error message example
|
||||
MSG_FORMAT = %{%s [%s] [%s]: %s\n}
|
||||
MSG_FORMAT = %{%s [%s]: [%s] %s\n}
|
||||
|
||||
# Mon Feb 27 06:02:30 2012
|
||||
DATE_FORMAT = "%a %b %d %H:%M:%S %Y"
|
||||
|
||||
# Message to be used in CloudLogger
|
||||
CLOUD_LOGGER_MSG = %{[%s] %s}
|
||||
|
||||
# Sets the server logger
|
||||
# @param [CloudLogger::CloudLogger, Logger] logger
|
||||
def logger=(logger)
|
||||
@@ -64,7 +67,7 @@ class Log
|
||||
if service_id
|
||||
add(Logger::INFO, component, message, service_id)
|
||||
else
|
||||
@@logger.info(message)
|
||||
@@logger.info(CLOUD_LOGGER_MSG % [component, message])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -81,7 +84,7 @@ class Log
|
||||
if service_id
|
||||
add(Logger::DEBUG, component, message, service_id)
|
||||
else
|
||||
@@logger.debug(message)
|
||||
@@logger.debug(CLOUD_LOGGER_MSG % [component, message])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -98,7 +101,7 @@ class Log
|
||||
if service_id
|
||||
add(Logger::ERROR, component, message, service_id)
|
||||
else
|
||||
@@logger.error(message)
|
||||
@@logger.error(CLOUD_LOGGER_MSG % [component, message])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -115,7 +118,7 @@ class Log
|
||||
if service_id
|
||||
add(Logger::WARN, component, message, service_id)
|
||||
else
|
||||
@@logger.warn(message)
|
||||
@@logger.warn(CLOUD_LOGGER_MSG % [component, message])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -130,8 +133,8 @@ class Log
|
||||
open("#{LOG_LOCATION}/appflow/#{service_id}.log", 'a') do |f|
|
||||
f << MSG_FORMAT % [
|
||||
Time.now.strftime(DATE_FORMAT),
|
||||
component,
|
||||
Logger::SEV_LABEL[severity][0..0],
|
||||
component,
|
||||
message ]
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ do_file() {
|
||||
rm $2/`basename $1`
|
||||
else
|
||||
if [ "$LINK" = "yes" ]; then
|
||||
ln -s $SRC_DIR/$1 $2
|
||||
ln -fs $SRC_DIR/$1 $2
|
||||
else
|
||||
cp -R $SRC_DIR/$1 $2
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user