---
name: "fedmsg-logger"
section: "1"
platform: "linux"
package: "fedmsg"
version: "0.9.3-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/fedmsg-logger"
---

# fedmsg-logger(1)

simply emit messages from the command-line to the fedmsg bus

## NAME

fedmsg-logger - simply emit messages from the command-line to the fedmsg bus

## SYNOPSIS

**fedmsg-logger** \[**--message** *LOGGER\_MESSAGE*\] \[**--json-input**\] \[**--topic** *TOPIC*\] \[**--modname** *MODNAME*\] \[**--cert-prefix** *CERT\_PREFIX*\] \[*\<common fedmsg options\>*\]

**fedmsg-logger** \[**-h**\|**--help**\]

## DESCRIPTION

**fedmsg-logger** is a simple command-line utility to send messages to the fedmsg bus. It is an ephemeral command, that doesn't bind a 0mq endpoint directly. It sends its messages to a [**fedmsg-relay**(1)](/fedmsg-relay/1.md) daemon that binds a persistent endpoint that the outside world can subscribe to.  If the [**fedmsg-relay**(1)](/fedmsg-relay/1.md) service is not running at the address specified in the config, then **fedmsg-logger** will hang until that service becomes available.

If **--message** is not specified, this command accepts messages from stdin.

## OPTIONS

- **-h**, **--help**

  Print an help message and exit

- **--message** LOGGER\_MESSAGE

  The message to send.

- **--json-input**

  Take each line of input as JSON.

- **--topic** TOPIC

  The topic to which the messages are sent. Defaults to *log* if unset.

- **--modname** MODNAME

  The module name to which the messages are sent. Defaults to *logger* if unset.

- **--cert-prefix** CERT\_PREFIX

  Specify a different cert from */etc/pki/fedmsg*

## COMMON FEDMSG OPTIONS

- **--io-threads** IO\_THREADS

  Number of io threads for 0mq to use

- **--topic-prefix** TOPIC\_PREFIX

  Prefix for the topic of each message sent.

- **--post-init-sleep** POST\_INIT\_SLEEP

  Number of seconds to sleep after initializing.

- **--config-filename** CONFIG\_FILENAME

  Config file to use.

- **--print-config**

  Simply print out the configuration and exit. No action taken.

- **--timeout** TIMEOUT

  Timeout in seconds for any blocking zmq operations.

- **--high-water-mark** HIGH\_WATER\_MARK

  Limit on the number of messages in the queue before blocking.

- **--linger** ZMQ\_LINGER

  Number of milliseconds to wait before timing out connections.

## TOPIC CONSTRUCTION

The full topic to which the messages are sent is constructed from the **topic\_prefix** and **environment** set in the fedmsg configuration, and the **--topic** TOPIC and **--modname** MODNAME options this way:

-

  **\<topic\_prefix\>**.**\<environment\>**.**MODNAME**.**TOPIC**

## CAVEATS

Note that when using **--json-input**, you must send valid JSON, including the use of double quotes as opposed to single quotes:

-

  {"a": 1} is valid JSON.

-

  {'a': 1} is invalid JSON.

## EXAMPLES

Send a message from standard input in JSON format:

```
echo '{"a": 1}' | fedmsg-logger --json-input
```

Send a message to the *git.repo.update* topic

```
echo "Hai there." | fedmsg-logger --modname=git --topic=repo.update
```

Send a simple message:

```
fedmsg-logger --message="This is a message."
```

Send a JSON-format message:

```
fedmsg-logger --message='{"a": 1}' --json-input
```

## SEE ALSO

[**fedmsg-relay**(1)](/fedmsg-relay/1.md), [**fedmsg-announce**(1)](/fedmsg-announce/1.md)

## AUTHORS

- **The Fedora Infrastructure team** \<messaging-sig@lists.fedoraproject.org\>

  Wrote the **fedmsg** software.

- **Nicolas Dandrimont** \<olasd@debian.org\>

  Wrote this manpage for the Debian system.

## COPYRIGHT

Copyright © 2014 Nicolas Dandrimont\

This manual page was written for the Debian system (and may be used by others).

You can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

On Debian systems, a copy of the license can be found in the */usr/share/common-licenses/LGPL-2.1* file.
