---
title: Choosing an Appender Framework for Custom Logging
description: Which logging appender framework should you use for Custom Logging? Compare Log4Net, Serilog, Log4J, and custom JSON generation.
---

# Which appender framework should I use (.NET/Java/Python)?

**Choose an appender framework based on your technology stack and deployment model.** Appender frameworks provide an abstraction layer, prevent vendor lock-in, and enable logging to multiple destinations simultaneously.

## .NET Framework → Use Log4Net

[Log4Net Appender][] for .NET Framework 4.x applications:

* ✅ Mature, battle-tested logging framework
* ✅ :Nodinite: provides custom appender - writes JSON [Log Events][] to intermediate storage
* ✅ Minimal code changes - configure in `app.config` or `web.config`
* ✅ Supports multiple destinations - :Nodinite: + local files + Splunk simultaneously

**Use cases:** Legacy BizTalk integrations, ASP.NET web services, Windows services

**Example:**

```csharp
log4net.ILog log = log4net.LogManager.GetLogger("MyIntegration");
log.Info("Order processed", new { OrderId = "PO-12345", CustomerId = "Contoso" });
```

## .NET Core / .NET → Use Serilog

[Serilog][] for modern .NET Core, .NET, Azure Functions:

* ✅ Structured logging with rich context
* ✅ :Nodinite: provides Serilog sink - writes to [Azure Service Bus][], Azure Storage, files
* ✅ Cloud-native - perfect for Azure Functions, microservices, containers
* ✅ High performance - asynchronous writing, batching

**Use cases:** Azure Functions, ASP.NET Core APIs, microservices, serverless

**Example:**

```csharp
Log.Information("Order {OrderId} processed for customer {CustomerId}", 
    "PO-12345", "Contoso");
```

## Java → Use Log4J or SLF4J

**Log4J / SLF4J** for Java-based integrations:

* ✅ Standard Java logging frameworks
* ✅ Custom appender writes :Nodinite: JSON Log Events
* ✅ Works with Apache Camel, Spring Boot, webMethods Java services

**Use cases:** Apache Camel routes, Spring Boot microservices, webMethods integrations

**Example:**

```java
logger.info("Order {} processed for customer {}", orderId, customerId);
```

## Python → Use Python logging module

**Python `logging` module** with custom handler:

* ✅ Built-in Python standard library
* ✅ Custom handler writes JSON to queue/file
* ✅ Structured logging with dictionaries

**Use cases:** Python batch jobs, Flask/Django APIs, data pipelines

**Example:**

```python
logging.info("Order processed", extra={
    "OrderId": "PO-12345", 
    "CustomerId": "Contoso"
})
```

## Node.js → Use Winston or Bunyan

**Winston / Bunyan** for Node.js integrations:

* ✅ Popular Node.js logging libraries
* ✅ Custom transport writes JSON Log Events
* ✅ Supports structured logging

**Use cases:** Express.js APIs, Node.js microservices, serverless functions

**Example (Winston):**

```javascript
logger.info("Order processed", { 
    orderId: "PO-12345", 
    customerId: "Contoso" 
});
```

## Custom JSON Generation → Any Platform

**Handcraft JSON Log Events** for platforms without appender support:

* ✅ Works with **any** technology (Go, Rust, PHP, Ruby, PowerShell, etc.)
* ✅ Full control over JSON structure
* ✅ Follow [JSON Log Event][] specification

**Use cases:** MuleSoft (use [Mule ESB Custom Connector][]), IBM Sterling, TEIS, custom platforms

**Example (any language):**

```json
{
  "LogAgentValueId": 42,
  "EndPointName": "Custom Integration",
  "OriginalMessageTypeName": "PurchaseOrder#1.0",
  "ApplicationInterchangeId": "a1b2c3d4-e5f6-7890",
  "LogMessage": "Order processed",
  "StateCode": 0,
  "Body": "<Order>...</Order>"
}
```

## Decision Matrix

|**Platform**|**Recommended Framework**|**Why**|  
|---|---|---|  
|:fab fa-microsoft: .NET Framework 4.x|[Log4Net Appender][]|Mature, proven, minimal changes|  
|:fab fa-microsoft: .NET Core / .NET 5-8|[Serilog][]|Modern, cloud-native, structured|  
|:fa-bolt: Azure Functions|[Serilog][]|Serverless-optimized|  
|:fab fa-java: Java (Camel, Spring)|Log4J / SLF4J|Java standard|  
|:fab fa-python: Python|`logging` module|Built-in, simple|  
|:fab fa-node-js: Node.js|Winston / Bunyan|Popular, flexible|  
|:fa-cube: MuleSoft|[Mule ESB Custom Connector][]|Pre-built connector|  
|:fa-cube: webMethods|Log4J (Java services) or custom|Platform-specific|  
|:fa-code: Other platforms|Custom JSON generation|Universal compatibility|  

**Need templates?** Review [Hello World Sample][] (.NET) or [Mule ESB Custom Connector][] for reference implementations.

---

**Related Topics:**  
[Log4Net Appender Documentation][]  
[Serilog Documentation][]  
[JSON Log Event Format][]  

**See all FAQs:** [Troubleshooting Overview][]

## :fa-hand-point-right: Next Steps

:fa-book: [Back to Custom Logging Overview][Custom Logging Overview]  

## :fa-link-horizontal: Related Topics

* :fa-question-circle: [Troubleshooting Overview][Troubleshooting]  

[Azure Service Bus]:{ndr}/Logging%20and%20Monitoring/Message%20Queueing/Features/Azure%20Service%20Bus%20Queues/Monitoring%20Azure%20Service%20Bus%20Queue.md
[Custom Logging Overview]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Overview.md
[Hello World Sample]:{ndr}/Core%20Services/Log%20API/Troubleshooting/FAQ%20-%20Hello%20World%20-%20.NET%20Sample.md
[JSON Log Event]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md
[JSON Log Event Format]:{ndr}/Core%20Services/Log%20Event/Features/JSON%20Log%20Event.md
[Log Events]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log4Net Appender]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Overview.md
[Log4Net Appender Documentation]:{ndr}/Logging%20and%20Monitoring/Log4Net%20Appender/Overview.md
[Mule ESB Custom Connector]:{ndr}/Logging%20and%20Monitoring/MuleSoft%20-%20AnyPoint%20Platform%20-%20Logging/Features/Custom%20Connector.md
[Serilog]:{ndr}/Logging%20and%20Monitoring/Serilog/Overview.md
[Serilog Documentation]:{ndr}/Logging%20and%20Monitoring/Serilog/Overview.md
[Troubleshooting]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Troubleshooting/Overview.md
[Troubleshooting Overview]:{ndr}/Logging%20and%20Monitoring/Custom%20Logging/Troubleshooting/Overview.md