REQUEST A DEMO

Tag: IKVM

How To Configure Log4J via C#

August 12, 2010 One of our products is currently using IKVM to interop with a java library. I kept seeing console warnings saying: log4j:WARN Please initialize the log4j system properly.   Clearly the java library uses log4j and it is not getting initialized by my application. A customer was rightfully confused by this message so I spent a little time getting log4j setup and working.   At first I was hoping I could host log4j configuration XML along side my log4net configuration but sadly that was a pipedream. I opted for this approach.   public const string Log4JConfigFileName = "log4j.config"; private static void ConfigureLog4J() {     if(File.Exists(Log4JConfigFileName))     {         PropertyConfigurator.configureAndWatch(Log4JConfigFileName);         return;     }     var patternLayout = new PatternLayout("%d [%t] %-5p %c - %m%n");     var consoleAppender = new ConsoleAppender(patternLayout);     var fileAppender = new RollingFileAppender(patternLayout, "./logs/file-extraction-errors.log", true);     fileAppender.setMaxFileSize("1MB");     fileAppender.setMaxBackupIndex(5);              var rootLogger = Logger.getRootLogger();     rootLogger.setLevel(Level.ERROR);     rootLogger.addAppender(fileAppender);     rootLogger.addAppender(consoleAppender); }   Look for…

Using the Tika Java Library In Your .Net Application With IKVM

July 2, 2010 Update   I've created a project page for TikaOnDotNet on github. Tika On DotNet   This may sound scary and heretical but did you know it is possible to leverage Java libraries from .Net applications with no TCP sockets or web services getting caught in the crossfire? Let me introduce you to IKVM, which is frankly magic:   IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components: A Java Virtual Machine implemented in .NET A .NET implementation of the Java class libraries Tools that enable Java and .NET interoperability   Using IKVM we have been able to successfully integrate our Dovetail Seeker search application with the Tika text extraction library implemented in Java. With Tika we can easily pull text out of rich documents from many supported formats. Why Tika?  Because there is nothing comparable in the .Net world as…