1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which function is responsible for sending a custom message…

Added 19 Jan 2024

Which function is responsible for sending a custom message to the system log?

  1. systemlog()
  2. syslog() Correct answer
  3. log_system()
  4. sys_log()

Correct answer

B. syslog()

12 views

MCQSEXAM

Explanation

The function responsible for sending a custom message to the system log in PHP is the syslog() function. This function is part of the syslog logging system in PHP and allows you to send log messages to the system logger.

<?php openlog("myScript", LOG_PID, LOG_USER); // Sending a custom log message syslog(LOG_INFO, "This is a custom log message"); closelog(); ?>

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs