Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6841049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:55:07+00:00 2026-05-26T23:55:07+00:00

I am logging messages like this in perl – syslog (LOG_INFO, this is info);

  • 0

I am logging messages like this in perl –

syslog ("LOG_INFO", "this is info");
syslog ("LOG_WARNING", "this is warning");

when I see these messages, I get this-

Nov 15 20:20:47 ubuntu tag-0.0.2[13399]: this is info
Nov 15 20:20:47 ubuntu tag-0.0.2[13399]: this is warning

The word “ubuntu” in syslog message happens to be host name of the local host.

Is there a way I can log locally and but specify a hostname?

My app processes data from other hosts and logs information about them. It will be great if I can specify the host name when I log messages, this way I can use third party tools easily as they can easily filter out logs based upon hostname.

btw, if I can add additional question- why are the logs not showing level of message? shouldn’t I expect to see “info” in info syslog message I am logging ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:55:07+00:00Added an answer on May 26, 2026 at 11:55 pm

    Probably the easiest way to accomplish this task is to set the syslog to receive messages over the network. For rsyslog, this is often in /etc/rsyslog.conf:

    # provides UDP syslog reception
    $ModLoad imudp
    $UDPServerRun 514
    

    I’m using UDP here because it is easy to do on just about any syslog daemon and demonstrating it is easy:

    $ echo "<0>Oct 11 22:14:15 mymachine testing" | nc -u localhost syslog
    ^C
    $ tail -1 /var/log/syslog
    Oct 11 22:14:15 mymachine testing
    

    In short: the <nnn> represents the facility and priority, as described in section 4.1.1 of the RFC. The timestamp is highly specified in 4.1.2: in short, three-letter English month abbreviations, no leading 0 — instead a leading space: Aug__8 rather than Aug_8 (underscores used because spaces collapse in code blocks). The hostname can’t have any domain portions. IP addresses are fine, both IPv4 and IPv6.

    You could also use Unix domain sockets (unix(7)) such as /dev/log. That would be more reliable than UDP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Glassfish server logs messages like this every 10 minutes or so: [#|2009-07-01T10:10:03.373+0930|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=21;_ThreadName=Timer-13;_RequestID=30966ccf-eac6-4cff-8256-22bc31862686;| java.lang.NullPointerException:
In settings.py I have setup a way to log my messages like this: logging.basicConfig(
I'm writing python package/module and would like the logging messages mention what module/class/function they
Using java.util.logging.Logger to output some log to the console just like this: public static
I have a small framework that is logging some info and debug messages using
I'm using Logging ( import logging ) to log messages. Within 1 single module,
I am currently logging an AJAX application with messages which include the times of
We use Log4j (and Commons Logging) to log our error messages. Now we want
I want to configure my log4j logging to not log messages that are 1)
I am looking into C# logging and I do not want my log messages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.