public CompileOnlyOptionFilePreProcessor(
     IFileSystem fileSystem,
     ILog logger,
     IEnumerable<ILineProcessor> lineProcessors)
     : base(fileSystem, logger, lineProcessors)
 {
 }
        private void ConvertToPdf(string fileIN, string fileOUT)
        {
            //string projectDir = Server.MapPath("~/");

            NameValueCollection commonLoggingproperties = new NameValueCollection();

            commonLoggingproperties["showDateTime"] = "false";
            commonLoggingproperties["level"]        = "INFO";
            Common.Logging.LogManager.Adapter       = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(commonLoggingproperties);


            Common.Logging.ILog log = Common.Logging.LogManager.GetCurrentClassLogger();
            log.Info("Hello from Common Logging");

            // Necessary, if slf4j-api and slf4j-NetCommonLogging are separate DLLs
            ikvm.runtime.Startup.addBootClassPathAssembly(
                System.Reflection.Assembly.GetAssembly(
                    typeof(org.slf4j.impl.StaticLoggerBinder)));

            // Configure to find docx4j.properties
            // .. add as URL the dir containing docx4j.properties (not the file itself!)
            Plutext.PropertiesConfigurator.setDocx4jPropertiesDir(Server.MapPath("~/src/samples/resources/"));

            //org.docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart.getTemporaryEmbeddedFontsDir()

            // OK, do it..
            org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage = org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(new java.io.File(fileIN));

            java.io.FileOutputStream fos = new java.io.FileOutputStream(new java.io.File(fileOUT));

            org.docx4j.Docx4J.toPDF(wordMLPackage, fos);

            fos.close();
        }
Beispiel #3
0
        static PeccancyQueryConfigManager()
        {
            var conn = ConfigurationManager.ConnectionStrings["Gungnir"].ConnectionString;

            grconnectionString = SecurityHelp.IsBase64Formatted(conn) ? SecurityHelp.DecryptAES(conn) : conn;
            Logger             = Common.Logging.LogManager.GetLogger(typeof(PeccancyQueryConfigManager));
        }
Beispiel #4
0
        private void PublishLogToCommonLogging(LogInfo item)
        {
            if (!_useLogger)
            {
                return;
            }

            Common.Logging.ILog logger = Common.Logging.LogManager.GetCurrentClassLogger();

            var bodyAsString = String.Empty;

            try
            {
                bodyAsString = Encoding.UTF8.GetString(item.Body);
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
                /* empty bodies should be allowed */
            }

            var type = item.RowType == 0 ? "" : item.RowType == 1 ? "Request" : "Response";

            logger.Debug(type + " | " +
                         item.Created + " | " +
                         item.StatusCode + " | " +
                         item.Url + " | " +
                         item.PathTranslated + " | " +
                         item.Identity + " | " +
                         "\n===>Headers<====\n" + item.Headers +
                         "\n===>Body<=======\n" + bodyAsString
                         );
        }
 public CompileOnlyOptionFilePreProcessor(
     IFileSystem fileSystem,
     ILog logger,
     IEnumerable <ILineProcessor> lineProcessors)
     : base(fileSystem, logger, lineProcessors)
 {
 }
Beispiel #6
0
 public AssemblyResolver(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IAssemblyUtility assemblyUtility,
     Common.Logging.ILog logger)
     : this(fileSystem, packageAssemblyResolver, assemblyUtility, new CommonLoggingLogProvider(logger))
 {
 }
Beispiel #7
0
 static BaoYangInstallFeeConfigManager()
 {
     Logger = Common.Logging.LogManager.GetLogger(typeof(BaoYangInstallFeeConfigManager));
     dbScopeManagerGungnir     = new DBScopeManager(gungnirConnRo);
     dbScopeManagerGungnirRead = new DBScopeManager(gungnirReadConnRo);
     dbScopeManagerConfig      = new DBScopeManager(configConnRo);
     dbScopeManagerConfigRead  = new DBScopeManager(configReadConnRo);
 }
 public static readonly string FriendlyName = typeof(UpsShipper).FullName;     /* here for my "trick" */
 public UpsShipper(Common.Logging.ILog lgr)
 {
     if (null == lgr)
     {
         throw new ArgumentOutOfRangeException("Log is null");
     }
     this.logger = lgr;
 }
Beispiel #9
0
 static BatteryLevelUpManager()
 {
     Logger = Common.Logging.LogManager.GetLogger(typeof(BatteryLevelUpManager));
     dbScopeManagerConfig      = new DBScopeManager(configConnString);
     dbScopeManagerConfigRead  = new DBScopeManager(configReadConnString);
     dbScopeManagerBaoYang     = new DBScopeManager(ConfigurationManager.ConnectionStrings["BaoYang"].ConnectionString);
     dbScopeManagerBaoYangRead = new DBScopeManager(ConfigurationManager.ConnectionStrings["BaoYang_AlwaysOnRead"].ConnectionString);
 }
Beispiel #10
0
 public InstallCommand(
     IPackageInstaller packageInstaller,
     IPackageAssemblyResolver packageAssemblyResolver,
     Common.Logging.ILog logger,
     IInstallationProvider installationProvider)
     : this(packageInstaller, packageAssemblyResolver, new CommonLoggingLogProvider(logger), installationProvider)
 {
 }
Beispiel #11
0
 static CouponActivityConfigManagerV2()
 {
     Logger = Common.Logging.LogManager.GetLogger(typeof(CouponActivityConfigManagerV2));
     dbScopeManagerConfig            = new DBScopeManager(configConnString);
     dbScopeManagerConfigRead        = new DBScopeManager(configReadConnString);
     dbScopeManagerConfiguration     = new DBScopeManager(ConfigurationManager.ConnectionStrings["Configuration"].ConnectionString);
     dbScopeManagerConfigurationRead = new DBScopeManager(ConfigurationManager.ConnectionStrings["Configuration_AlwaysOnRead"].ConnectionString);
 }
Beispiel #12
0
        public ScriptConsoleLogger(LogLevel consoleLogLevel, IConsole console, Common.Logging.ILog log)
        {
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("log", log);

            _consoleLogLevel = consoleLogLevel;
            _console         = console;
            _log             = log;
        }
        public ScriptConsoleLogger(LogLevel consoleLogLevel, IConsole console, Common.Logging.ILog log)
        {
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("log", log);

            _consoleLogLevel = consoleLogLevel;
            _console = console;
            _log = log;
        }
Beispiel #14
0
 public ScriptExecutor(
     IFileSystem fileSystem,
     IFilePreProcessor filePreProcessor,
     IScriptEngine scriptEngine,
     Common.Logging.ILog logger,
     IScriptLibraryComposer composer)
     : this(fileSystem, filePreProcessor, scriptEngine, new CommonLoggingLogProvider(logger), composer)
 {
 }
        static BatteryFastDeliveryConfigManager()
        {
            Logger = Common.Logging.LogManager.GetLogger(typeof(BatteryFastDeliveryConfigManager));
            dbScopeManagerConfig      = new DBScopeManager(configConnString);
            dbScopeManagerConfigRead  = new DBScopeManager(configReadConnString);
            dbScopeManagerProductRead = new DBScopeManager(productReadConnString);

            dbScopeManagerGungnir     = new DBScopeManager(ConfigurationManager.ConnectionStrings["Gungnir"].ConnectionString);
            dbScopeManagerGungnirRead = new DBScopeManager(ConfigurationManager.ConnectionStrings["Gungnir_AlwaysOnRead"].ConnectionString);
        }
Beispiel #16
0
 public AppDomainAssemblyResolver(
     Common.Logging.ILog logger,
     IFileSystem fileSystem,
     IAssemblyResolver resolver,
     IAssemblyUtility assemblyUtility,
     IDictionary <string, AssemblyInfo> assemblyInfoMap       = null,
     Func <object, ResolveEventArgs, Assembly> resolveHandler = null)
     : this(new CommonLoggingLogProvider(logger), fileSystem, resolver, assemblyUtility, assemblyInfoMap, resolveHandler)
 {
 }
Beispiel #17
0
 static Logger()
 {
     try
     {
         log = Common.Logging.LogManager.GetLogger(typeof(Logger));
     }
     catch (Exception ex)
     {
         throw new TypeInitializationException("NCI.Logging.Logger", ex);
     }
 }
Beispiel #18
0
        public TaskHandler()
        {
            _Logger = Common.Logging.LogManager.GetLogger(GetType());

            //依据配置文件获取需要调度任务
            var fact = new Quartz.Impl.StdSchedulerFactory();
            _Scheduler = fact.GetScheduler();

            //在此注册任务处理模块时间处理
            JobBaseHandler.OnExecute += JobBaseHandler_OnExecute;
        }
Beispiel #19
0
        public void U__ElmahLogger__Config()
        {
            Common.Logging.ILog logger = Common.Logging.LogManager.GetCurrentClassLogger();

            logger.Error("Test");

            var list = new List <global::Elmah.ErrorLogEntry>();

            global::Elmah.ErrorLog.GetDefault(null).GetErrors(0, 20, list);

            Assert.AreEqual(0, list.Count);
        }
Beispiel #20
0
 public ScriptServicesBuilder(
     IConsole console,
     Common.Logging.ILog logger,
     IRuntimeServices runtimeServices = null,
     ITypeResolver typeResolver       = null,
     IInitializationServices initializationServices = null)
     : this(
         console,
         new CommonLoggingLogProvider(logger),
         runtimeServices,
         typeResolver,
         initializationServices)
 {
 }
Beispiel #21
0
        private static void ConfigureLog(string level)
        {
            // create properties
            var properties = new System.Collections.Specialized.NameValueCollection()
            {
                { "level", level.ToUpperInvariant() },
                { "showDateTime", "true" },
                { "showLogName", "true" },
                { "dateTimeFormat", "yyyy/MM/dd HH:mm:ss:fff" }
            };

            // set Adapter
            Common.Logging.LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(properties);
            logger = Common.Logging.LogManager.GetCurrentClassLogger();
        }
Beispiel #22
0
        public void Configure()
        {
            var hierarchy       = (Hierarchy)LogManager.GetRepository();
            var logger          = LogManager.GetLogger(LoggerName);
            var consoleAppender = new ConsoleAppender
            {
                Layout    = new PatternLayout(GetLogPattern(_logLevel)),
                Threshold = hierarchy.LevelMap[_logLevel.ToString().ToUpper(CultureInfo.CurrentCulture)]
            };

            hierarchy.Root.AddAppender(consoleAppender);
            hierarchy.Root.Level = Level.All;
            hierarchy.Configured = true;

            _logger = new CodeConfigurableLog4NetLogger(logger);
        }
Beispiel #23
0
        public void Configure(IConsole console)
        {
            var hierarchy = (Hierarchy)LogManager.GetRepository();
            var logger = LogManager.GetLogger(LoggerName);
            var consoleAppender = new ScriptConsoleAppender(console)
            {
                Layout = new PatternLayout(GetLogPattern(_logLevel)),
                Threshold = hierarchy.LevelMap[_logLevel.ToString().ToUpper(CultureInfo.CurrentCulture)]
            };

            hierarchy.Root.AddAppender(consoleAppender);
            hierarchy.Root.Level = Level.All;
            hierarchy.Configured = true;

            _logger = new CodeConfigurableLog4NetLogger(logger);
        }
Beispiel #24
0
        public void Run(string filePath)
        {
            Common.Logging.ILog log = Common.Logging.LogManager.GetLogger("Magnetar.Logger");



            var package = new ExcelPackage();

            using (var stream = File.OpenRead(filePath))
            {
                package.Load(stream);
            }

            ExcelWorksheet workSheet = package.Workbook.Worksheets[1];

            Dictionary <int, string> columns = new Dictionary <int, string>();


            for (int i = workSheet.Dimension.Start.Row;
                 i <= workSheet.Dimension.End.Row;
                 i++)
            {
                var  row      = workSheet.Cells[string.Format("{0}:{0}", i)];
                bool allEmpty = row.All(c => string.IsNullOrWhiteSpace(c.Text));
                if (allEmpty)
                {
                    continue;           // skip this row
                }
                string[] vals = new string[workSheet.Dimension.End.Column];
                for (int j = workSheet.Dimension.Start.Column; j <= workSheet.Dimension.End.Column; j++)
                {
                    if (i == 1)
                    {
                        columns.Add(j, workSheet.Cells[i, j].Text);
                    }

                    object cellValue = workSheet.Cells[i, j].Value;

                    var val = cellValue ?? ProcessObject(cellValue);
                    vals[j - 1] = val.ToString();
                }
                log.InfoFormat(string.Join("|", vals));
            }
        }
Beispiel #25
0
 public Repl(
     string[] scriptArgs,
     IFileSystem fileSystem,
     IScriptEngine scriptEngine,
     IObjectSerializer serializer,
     Common.Logging.ILog logger,
     IScriptLibraryComposer composer,
     IConsole console,
     IFilePreProcessor filePreProcessor,
     IEnumerable <IReplCommand> replCommands)
     : this(
         scriptArgs,
         fileSystem,
         scriptEngine,
         serializer,
         new CommonLoggingLogProvider(logger),
         composer,
         console,
         filePreProcessor,
         replCommands)
 {
 }
        /// <summary> Open session
        /// </summary>
        /// <param name="logger">logger</param>
        /// <returns>NHibernate session</returns>
        /// <remarks>For opening session with <seealso cref="global::NHibernate.IInterceptor"/> you must specify NHInterceptor item in Spring.NET</remarks>
        public static ISession OpenSession(Common.Logging.ILog logger = null)
        {
            ISession session     = null;
            var      interceptor = CTI.Spring.IoC.Get <global::NHibernate.IInterceptor>("NHInterceptor");

            if (null == interceptor)
            {
                session = SessionFactory.OpenSession();

                logger?.Debug("OpenSession()");
            }
            else
            {
                session = SessionFactory.OpenSession(interceptor);

                if (logger?.IsDebugEnabled == true)
                {
                    logger.Debug($"OpenSession({interceptor.GetType().AssemblyQualifiedName})");
                }
            }
            return(session);
        }
Beispiel #27
0
 public RuntimeServices(
     Common.Logging.ILog logger,
     IDictionary <Type, object> overrides,
     IConsole console,
     Type scriptEngineType,
     Type scriptExecutorType,
     Type replType,
     bool initDirectoryCatalog,
     IInitializationServices initializationServices,
     string scriptName)
     : this(
         new CommonLoggingLogProvider(logger),
         overrides,
         console,
         scriptEngineType,
         scriptExecutorType,
         replType,
         initDirectoryCatalog,
         initializationServices,
         scriptName)
 {
 }
Beispiel #28
0
 public ScriptServices(
     IFileSystem fileSystem,
     IPackageAssemblyResolver packageAssemblyResolver,
     IScriptExecutor executor,
     IRepl repl,
     IScriptEngine engine,
     IFilePreProcessor filePreProcessor,
     IScriptPackResolver scriptPackResolver,
     IPackageInstaller packageInstaller,
     IObjectSerializer objectSerializer,
     Common.Logging.ILog logger,
     IAssemblyResolver assemblyResolver,
     IEnumerable <IReplCommand> replCommands,
     IFileSystemMigrator fileSystemMigrator,
     IConsole console = null,
     IInstallationProvider installationProvider   = null,
     IScriptLibraryComposer scriptLibraryComposer = null
     )
     : this(
         fileSystem,
         packageAssemblyResolver,
         executor,
         repl,
         engine,
         filePreProcessor,
         scriptPackResolver,
         packageInstaller,
         objectSerializer,
         new CommonLoggingLogProvider(logger),
         assemblyResolver,
         replCommands,
         fileSystemMigrator,
         console,
         installationProvider,
         scriptLibraryComposer
         )
 {
 }
Beispiel #29
0
        public void Log(string user, LogContentEntity logContentEntity)
        {
            var appenderName = GetAppenderName(user, FileAppenderHelper.ConvertLogLevel(logContentEntity.Level));

            Common.Logging.ILog log = Common.Logging.LogManager.GetLogger(appenderName);

            if (log.IsDebugEnabled && logContentEntity.Level == "Debug")
            {
                log.Debug(logContentEntity.ToString());
            }
            if (log.IsInfoEnabled && logContentEntity.Level == "Info")
            {
                log.Info(logContentEntity.ToString());
            }
            if (log.IsWarnEnabled && logContentEntity.Level == "Warn")
            {
                log.Warn(logContentEntity.ToString());
            }
            if (log.IsErrorEnabled && logContentEntity.Level == "Error")
            {
                log.Error(logContentEntity.ToString());
            }
        }
Beispiel #30
0
 public Logger(ICommonLogger logger, string name)
 {
     _logger = logger;
     Name    = name;
 }
 static LiveWorkShopConfigManager()
 {
     Logger = Common.Logging.LogManager.GetLogger(typeof(LiveWorkShopConfigManager));
     dbScopeManagerConfig     = new DBScopeManager(configConnRo);
     dbScopeManagerConfigRead = new DBScopeManager(configReadConnRo);
 }
Beispiel #32
0
 public LinkThem(Spring.Data.NHibernate.HibernateTemplate ht, Spring.Web.UI.Page page, Common.Logging.ILog log)
   {
       this.ht = ht;
       this.page = page;
       this.log = log;
   }
 public CommonLogging(Common.Logging.ILog log)
 {
     _log = log;
 }
Beispiel #34
0
 public InitializationServices(Common.Logging.ILog logger, IDictionary <Type, object> overrides = null)
     : this(new CommonLoggingLogProvider(logger), overrides)
 {
 }
Beispiel #35
0
 private static void ConfigureLog (string level)
 {
     // create properties
     var properties = new System.Collections.Specialized.NameValueCollection ()
     {
         { "level", level.ToUpperInvariant () },
        { "showDateTime", "true" },
         { "showLogName", "true" },
         { "dateTimeFormat", "yyyy/MM/dd HH:mm:ss:fff" }
     };
     // set Adapter
     Common.Logging.LogManager.Adapter = new Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter (properties);
     logger = Common.Logging.LogManager.GetCurrentClassLogger ();
 }
 public ProductStatusSyncExecutor(DateTime benchTime, ILog logger)
     : base(benchTime, logger)
 {
 }
 public void Configure(IConsole console)
 {
     _logger = new ScriptConsoleLogger(_logLevel, console, Common.Logging.LogManager.GetLogger(LoggerName));
 }
Beispiel #38
0
 public DaoAccess()
 {
     log = Common.Logging.LogManager.GetLogger(this.GetType());
 }
 public ParamoreLogger(Common.Logging.ILog logger)
 {
     this.logger = logger;
 }
 /// <summary> 
 /// 初始化
 /// </summary>
 /// <param name="name"></param>
 public DefaultLogger(Common.Logging.ILog log)
 {
     this._log = log;
 }
 public CommonLogging(Common.Logging.ILog log)
 {
     _log = log;
 }
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="name"></param>
 public DefaultLogger(Common.Logging.ILog log)
 {
     this._log = log;
 }
        public CommonLoggingLogProvider(Common.Logging.ILog logger)
        {
            Guard.AgainstNullArgument("logger", logger);

            _logger = logger;
        }