diff --git a/Teknik/Configuration/Config.cs b/Teknik/Configuration/Config.cs index 89d0682..d0a4cd1 100644 --- a/Teknik/Configuration/Config.cs +++ b/Teknik/Configuration/Config.cs @@ -41,6 +41,7 @@ namespace Teknik.Configuration private ShortenerConfig _ShortenerConfig; private TransparencyConfig _TransparencyConfig; private DatabaseConfig _DatabaseConfig; + private LoggingConfig _LoggingConfig; private PiwikConfig _PiwikConfig; public bool DevEnvironment { get { return _DevEnvironment; } set { _DevEnvironment = value; } } @@ -98,6 +99,9 @@ namespace Teknik.Configuration // Database Configuration public DatabaseConfig DatabaseConfig { get { return _DatabaseConfig; } set { _DatabaseConfig = value; } } + // Logging Configuration + public LoggingConfig LoggingConfig { get { return _LoggingConfig; } set { _LoggingConfig = value; } } + // Piwik Configuration public PiwikConfig PiwikConfig { get { return _PiwikConfig; } set { _PiwikConfig = value; } } @@ -139,6 +143,7 @@ namespace Teknik.Configuration ShortenerConfig = new ShortenerConfig(); TransparencyConfig = new TransparencyConfig(); DatabaseConfig = new DatabaseConfig(); + LoggingConfig = new LoggingConfig(); PiwikConfig = new PiwikConfig(); } diff --git a/Teknik/Configuration/LoggingConfig.cs b/Teknik/Configuration/LoggingConfig.cs new file mode 100644 index 0000000..f744204 --- /dev/null +++ b/Teknik/Configuration/LoggingConfig.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Teknik.Configuration +{ + public class LoggingConfig + { + public bool Enabled { get; set; } + + public string OutputDirectory { get; set; } + + public string LogLevel { get; set; } + + public bool RotateLogs { get; set; } + + public long MaxSize { get; set; } + + public int MaxCount { get; set; } + + public LoggingConfig() + { + SetDefaults(); + } + + public void SetDefaults() + { + Enabled = true; + OutputDirectory = string.Empty; + LogLevel = "Info"; + RotateLogs = false; + MaxSize = -1; + MaxCount = -1; + } + } +} \ No newline at end of file diff --git a/Teknik/Teknik.csproj b/Teknik/Teknik.csproj index 98a2171..34451fc 100644 --- a/Teknik/Teknik.csproj +++ b/Teknik/Teknik.csproj @@ -241,6 +241,7 @@ + diff --git a/Utilities/Logging/LogLevel.cs b/Utilities/Logging/LogLevel.cs new file mode 100644 index 0000000..14a6d8a --- /dev/null +++ b/Utilities/Logging/LogLevel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Teknik.Logging +{ + public enum LogLevel + { + Trace = 0, + Debug = 1, + Info = 2, + Warning = 3, + Error = 4 + } +} diff --git a/Utilities/Logging/Logger.cs b/Utilities/Logging/Logger.cs index cac3421..8a98041 100644 --- a/Utilities/Logging/Logger.cs +++ b/Utilities/Logging/Logger.cs @@ -12,5 +12,14 @@ namespace Teknik.Logging { } + + public void WriteEntry(Exception ex) + { + // write an entry to the logs + } + + public void WriteEntry(string message, LogLevel level) + { + } } } diff --git a/Utilities/Logging/Logging.csproj b/Utilities/Logging/Logging.csproj index ab8c8f1..5231936 100644 --- a/Utilities/Logging/Logging.csproj +++ b/Utilities/Logging/Logging.csproj @@ -43,6 +43,7 @@ +