From d40b9ce26d9df5c9245d9a4f3c07c91dd1706f06 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 5 Jul 2012 21:59:37 +0300 Subject: Admin gitolite logs. Refactored project creation. Few style fixes. --- lib/gitlab/logger.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb index 45a990713f2..e8d20ad90c2 100644 --- a/lib/gitlab/logger.rb +++ b/lib/gitlab/logger.rb @@ -2,7 +2,13 @@ module Gitlab class Logger def self.error(message) @@logger ||= ::Logger.new(File.join(Rails.root, "log/githost.log")) + message = Time.now.to_s(:long) + " -> " + message @@logger.error(message) end + + def self.read_latest + path = Rails.root.join("log/githost.log") + logs = `tail -n 50 #{path}`.split("\n") + end end end -- cgit v1.2.1