---
title: "java: Post messages over HTTP using Java"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/configuring-destinations-http/"
last_modified: "2026-08-02T11:39:11+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# java: Post messages over HTTP using Java

Version 3.7 of AxoSyslog can directly post log messages to web services using the HTTP protocol. Error and status messages received from the HTTP server are forwarded to the internal logs of AxoSyslog. The current implementation has the following limitations:

- Only HTTP connections are supported, HTTPS is not.
- This destination requires Java. For an `http` destination that does not use Java, see [http: Post messages over HTTP without Java](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/configuring-destinations-http-nonjava/index.md).

## Prerequisites

The Java HTTP module is no longer shipped with AxoSyslog: it isn’t part of the `axosyslog-mod-java` (Debian/Ubuntu) or `axosyslog-java` (RHEL and compatible distributions) package. Use the [http: Post messages over HTTP without Java](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/configuring-destinations-http-nonjava/index.md) destination instead, which is available in the `axosyslog-mod-http`/`axosyslog-http` package.

## Declaration:

```shell
   java(
        class-path("/syslog-ng/install_dir/lib/syslog-ng/java-modules/*.jar")
        class-name("org.syslog_ng.http.HTTPDestination")

        option("url", "http://<server-address>:<port-number>")

    );
```

## Example: Sending log data to a web service

The following example defines an `http` destination.

```shell
   destination d_http {
        java(
            class-path("/syslog-ng/install_dir/lib/syslog-ng/java-modules/*.jar")
            class-name("org.syslog_ng.http.HTTPDestination")

            option("url", "http://192.168.1.1:80")
        );
    };

    log
        { source(s_file); destination(d_http); flags(flow-control); };
```

> **Note:**
> If you delete all Java destinations from your configuration and reload `syslog-ng`, the JVM is not used anymore, but it is still running. If you want to stop JVM, stop `syslog-ng` and then start `syslog-ng` again.

---

[HTTP destination options](https://axoflow.com/docs/axosyslog-core/4.28/chapter-destinations/configuring-destinations-http/reference-destination-http/index.md)

Last modified August 2, 2026: [Adds required modules/packages to install and destination pages (553d6d9b)](https://github.com/axoflow/axosyslog-core-docs/commit/553d6d9be9a0e3ef444e62cc5351dd2ac764f01d)
