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

  • Home
  • SEARCH
  • 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 8057453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:02:22+00:00 2026-06-05T09:02:22+00:00

I wrote a simple test application to log something in a log file. I

  • 0

I wrote a simple test application to log something in a log file. I am using linux mint and after the application executes I try to view the log using this command:

tail -n 100 /var/log/messages

but the file messages does not exist neither tested or something. Below you can find my code. Maybe I am doing something wrong, the file isn’t stored there or I need to enable logging in linux mint.

#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>

void init_log()
{
    setlogmask(LOG_UPTO(LOG_NOTICE));
    openlog("testd",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
}

int main(void) {

    init_log();
    printf("Session started!");
    syslog(LOG_NOTICE, "Session started!!");
    closelog();

    return EXIT_SUCCESS;
}
  • 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-06-05T09:02:24+00:00Added an answer on June 5, 2026 at 9:02 am

    On my Ubuntu machine, I can see the output at /var/log/syslog.

    On a RHEL/CentOS machine, the output is found in /var/log/messages.

    This is controlled by the rsyslog service, so if this is disabled for some reason you may need to start it with systemctl start rsyslog.

    As noted by others, your syslog() output would be logged by the /var/log/syslog file.
    You can see system, user, and other logs at /var/log.

    For more details: here’s an interesting link.

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

Sidebar

Related Questions

I wrote simple silverlight web application using the default ASP test page. If there
I wanted to test Mono AOT, so I wrote a simple console application with
I'm testing a simple DLL, I wrote using C++/CLI, in a CLR console application.
I wrote a simple program to test a theory that finally block will always
I wrote an XML RPC server in python and a simple Test Client for
A couple of weeks ago, I wrote a simple Ruby script to test a
I wrote a simple Sinatra app that generate an image using rmagick from some
I wrote a simple UpDown UserControl for my application. I am rendering it in
I am trying to write a simple integration test on a Rails 3.1 application
I'm learing LINQ-to-SQL right now and i have wrote a simple application that define

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.