コード例 #1
0
        private static void ConfigureLog()
        {
            _logger = new Logger();
            _logger.AddLogTarget(new ConsoleLogTarget());
            _logger.AddLogTarget(new DebugLogTarget());

            string path = Assembly.GetExecutingAssembly().Location;

            path = Path.Combine(Path.GetDirectoryName(path), "log.txt");
            _logger.AddLogTarget(new FileLogTarget(path));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: branjsmo1983/cSharp
        private static void ConfigureLog()
        {
            _logger = new Logger();
            _logger.AddLogTarget(new ConsoleLogTarget());
            _logger.AddLogTarget(new DebugLogTarget());

            _logger.AddLogTarget(new DatabaseLogTarget(
                                     "Server=192.168.9.219; Database=Logger; User Id=corso; Password=corso;"));

            string path = Assembly.GetExecutingAssembly().Location;

            path = Path.Combine(Path.GetDirectoryName(path), "log.txt");
            _logger.AddLogTarget(new FileLogTarget(path));
        }