IKVM.Extensions.Logging.Java.Util 1.0.1

Prefix Reserved
dotnet add package IKVM.Extensions.Logging.Java.Util --version 1.0.1
                    
NuGet\Install-Package IKVM.Extensions.Logging.Java.Util -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IKVM.Extensions.Logging.Java.Util" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IKVM.Extensions.Logging.Java.Util" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="IKVM.Extensions.Logging.Java.Util" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IKVM.Extensions.Logging.Java.Util --version 1.0.1
                    
#r "nuget: IKVM.Extensions.Logging.Java.Util, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IKVM.Extensions.Logging.Java.Util@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IKVM.Extensions.Logging.Java.Util&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=IKVM.Extensions.Logging.Java.Util&version=1.0.1
                    
Install as a Cake Tool

IKVM.Extensions.Logging.Java.Util

NuGet

A java.util.logging.Handler that forwards the records raised by Java code running under IKVM to Microsoft.Extensions.Logging, so a Java library logs through the same pipeline as the rest of the application instead of writing to its own console handler.

Supported platforms

Targets .NET 8, and is verified on .NET 8 and .NET 10.

Install

dotnet add package IKVM.Extensions.Logging.Java.Util

Use

Attach a handler to the logger whose subtree should be forwarded, which is usually the root:

using IKVM.Extensions.Logging.Java.Util;

using java.util.logging;

var root = LogManager.getLogManager().getLogger("");

// otherwise every record is also written to the console by java.util.logging's own default handler
foreach (var handler in root.getHandlers())
    root.removeHandler(handler);

root.addHandler(new LoggerHandler(loggerFactory));
root.setLevel(Level.ALL);

A record reaches the handler under the name of the Java logger that raised it, so the category an ILogger is created with is the Java logger name — org.apache.calcite.plan.hep.HepPlanner, for example — and the usual Logging:LogLevel configuration filters on it by prefix.

Levels

Levels are mapped by value, so a custom level sits wherever its severity puts it:

java.util.logging LogLevel
SEVERE and above Error
WARNING Warning
INFO, CONFIG Information
FINE Debug
FINER, FINEST Trace
OFF dropped

A Java logger filters on its own level before any handler is reached. A subtree left at its default INFO forwards nothing finer no matter how permissive the ILoggerFactory is, which is why the example above sets Level.ALL on the root: set the Java side to the finest level any ILogger rule asks for, and let Microsoft.Extensions.Logging do the filtering from there.

Notes

  • flush() does nothing. Records are handed over as they arrive, and any buffering past that point belongs to the logging provider.
  • close() stops forwarding but leaves the ILoggerFactory open — it belongs to the caller.
  • A failure inside the logging pipeline goes to the handler's ErrorManager rather than propagating into the Java code that raised the record.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 84 9/15/2026
0.1.9 455 6/6/2023
0.1.7 305 6/6/2023
0.1.6 302 6/6/2023