JavaScript Questions & Answers – Remote Logging

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Remote Logging”.

1. Which of the following are JavaScript logging library?
a) log
b) loglevel
c) leveljavascript
d) jslogjava
View Answer

Answer: b
Explanation: loglevel is a JavaScript logging library that is reliable and extremely easy-to-use over the various console.log() methods. loglevel is a lightweight, minimal and convenient JavaScript logging library which provides a reliable and extremely easy-to-use layer over the various console.log() methods that are often available, with none of their downsides.

2. What is the significance of the JavaScript logging library loglevel?
a) Lightweight
b) Unreliable
c) Minimal usage
d) Inconvenient
View Answer

Answer: a
Explanation: loglevel is a lightweight, minimal and convenient JavaScript logging library which provides a reliable and extremely easy-to-use layer over the various console.log() methods that are often available, with none of their downsides. loglevel makes these methods safe to use by gracefully handling the cases where they don’t exist and also lets you filter the output of these, to only show messages at warn level or above.

3. Which of the following browsers support the usage of the JavaScript logging library log4javascript?
a) IE
b) Safari
c) Opera
d) All of the mentioned
View Answer

Answer: d
Explanation: Apache Log4j is a Java-based logging utility. It was originally written by Ceki Gülcü and is part of the Apache Logging Services project of the Apache Software Foundation. Since a major use of JavaScript logging is in browser testing, log4javascript is tested and works across all recent major browsers, including:

  • Internet Explorer 5+ for Windows
  • Mozilla, Firefox, Netscape
  • Google Chrome
  • Safari 1.3+
  • Opera 7.5+
  • WebKit
  • Konqueror 3.4+
advertisement
advertisement

4. What is the significance of the JavaScript logging library log4javascript?
a) Fully featured
b) Easy to use
c) Fully featured and easy to use
d) Easily accessible
View Answer

Answer: c
Explanation: Apache Log4j is a Java-based logging utility.log4javascript is a fully-featured, easy-to-use JavaScript logging framework based on the Java logging framework log4j. Its purpose is to provide JavaScript developers with a familiar, robust and flexible logging framework with which to debug JavaScript applications.

5. Which of the following JavaScript logging framework lets one to toggle the plane?
a) Lumberjack
b) Log Hound
c) jsTracer
d) fvlogger
View Answer

Answer: a
Explanation: Lumberjack is a JavaScript utility that hijacks the browser console, makes it more beautiful and enhances it so logs can be split into more manageable chunks. Lumberjack also saves everything that is logged (so you can review later) and colorizes your logs (where supported) to increase legibility.

6. Which of the following JavaScript logging tool is also a debugging tool?
a) Blackbird
b) Log Hound
c) jsTracer
d) fvlogger
View Answer

Answer: c
Explanation: jsTracer is a simple yet feature rich JavaScript logging and debugging tool. It is especially useful for debugging what has been coined “Web 2.0” code. It helps in dynamic tracing for JavaScript, written in JavaScript, providing you insight into your live nodejs applications, at the process, machine, or cluster level.

7. Which of the following JavaScript logging tool is standalone?
a) Blackbird
b) Log Hound
c) jsTracer
d) fvlogger
View Answer

Answer: b
Explanation: Log Hound is a tool that was designed for finding frequent patterns from event log data sets with the help of a breadth-first frequent itemset mining algorithm. LogHound can be employed for mining frequent line patterns from raw event logs, e.g. Log Hound is a standalone JavaScript logging utility that allows you to log messages during execution of JavaScript code.
advertisement

8. Which of the following is not an appenders?
a) DummyAppender
b) ConsoleAppender
c) FileAppender
d) DeleteAppender
View Answer

Answer: d
Explanation: There are several ways to log using “appender”s. Some of the current available Appenders are:

  • DummyAppender: log nothing.
  • ConsoleAppender: open a new window in the browser or an inline div element and insert log messages in real time.
  • WindowsEventAppender: send log messages in the MS Windows event manager (Internet Explorer only).
  • FileAppender: write log messages in a local file on the client (IE and Mozilla).
  • AjaxAppender: allow to send log messages to a remote server with asynchronous HTTP request.
  • MetatagAppender: add log messages as meta data.
  • JavaScript Console Appenders for Opera, Mozilla and Safari.
  • 9. Which of the following reads the textual contents of a URL and returns as a string?
    a) spawn(f);
    b) load(filename,…);
    c) readFile(file);
    d) readUrl(url);
    View Answer

    Answer: d
    Explanation: readUrl() opens an input connection to the given string url, read all its bytes and convert them to a string using the specified character coding or default character coding if an explicit coding argument is not given.
    advertisement

    10. When does JSNLog have server-side extensions?
    a) Use of .NET
    b) Use of Java
    c) Both .NET and Java
    d) Use of C#
    View Answer

    Answer: a
    Explanation: If you use .Net, JSNLog has server side extensions that receive log data from the browser and have it logged on the server. And it lets you configure your loggers in your web.config. It includes a large class library named as Framework Class Library and provides language interoperability across several programming languages.

    Sanfoundry Global Education & Learning Series – Javascript Programming.

    If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

    advertisement
    advertisement
    Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

    Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
    Manish Bhojasia - Founder & CTO at Sanfoundry
    Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

    Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.