Fix applicationName typo

This commit is contained in:
ajimix 2019-03-22 12:18:56 +08:00
parent aa99167814
commit 2cb30e652d
9 changed files with 40 additions and 33 deletions

View File

@ -50,7 +50,7 @@ create formatted messages or use directly
**RFC3164**
```js
let rfc3164 = new SyslogPro.RFC3164({
applacationName: 'MyApp',
applicationName: 'MyApp',
color: true,
extendedColor: true,
server: {
@ -63,7 +63,7 @@ create formatted messages or use directly
**RFC5424**
```js
let rfc5424 = new SyslogPro.RFC5424({
applacationName: 'MyApp',
applicationName: 'MyApp',
timestamp: true,
encludeStructuredData: true
color: true,

View File

@ -263,7 +263,7 @@ Construct a new RFC3164 formatted Syslog object with user options
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [options] | <code>object</code> | | Options object |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.applicationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.hostname] | <code>string</code> | <code>&quot;os.hostname&quot;</code> | The name of this server |
| [options.facility] | <code>number</code> | <code>23</code> | Facility code to use sending this message |
| [options.color] | <code>boolean</code> | <code>false</code> | Apply color coding encoding tag with syslog message text |
@ -668,7 +668,7 @@ Construct a new RFC5424 formatted Syslog object with user options
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [options] | <code>object</code> | | Options object |
| [options.applacationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.applicationName] | <code>string</code> | <code>&quot;&#x27;NodeJSLogger&#x27;&quot;</code> | Application |
| [options.hostname] | <code>string</code> | <code>&quot;os.hostname&quot;</code> | The name of this server |
| [options.timestamp] | <code>boolean</code> | <code>false</code> | Included a Timestamp |
| [options.timestampUTC] | <code>boolean</code> | <code>false</code> | RFC standard is for local time |

View File

@ -624,7 +624,7 @@ class RFC3164 {
* @public
* @this RFC3164
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {number} [options.facility=23] - Facility code to use sending this
* message
@ -667,7 +667,7 @@ class RFC3164 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
this.applicationName = options.applicationName || '';
this.facility = options.facility || 23;
if (options.color) {
/** @type {boolean} */
@ -1016,7 +1016,7 @@ Build message
fmtMsg = '<' + pri + '>';
fmtMsg += timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + msg;
fmtMsg += newLine;
resolve(fmtMsg);
@ -1258,7 +1258,7 @@ class RFC5424 {
* @public
* @this RFC5424
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {boolean} [options.timestamp=false] - Included a Timestamp
* @param {boolean} [options.timestampUTC=false] - RFC standard is for
@ -1308,7 +1308,7 @@ class RFC5424 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
this.applicationName = options.applicationName || '';
if (typeof options.timestamp === 'undefined' || options.timestamp) {
/** @type {boolean} */
this.timestamp = true;
@ -1791,7 +1791,7 @@ Build the message
fmtMsg += '1'; // Version number
fmtMsg += ' ' + timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + pid;
fmtMsg += ' ' + id;
fmtMsg += ' ' + structuredData;

View File

@ -637,7 +637,7 @@
* @public
* @this RFC3164
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {number} [options.facility=23] - Facility code to use sending this
* message
@ -680,7 +680,7 @@
<span class="hljs-keyword">this</span>.constructor__ = <span class="hljs-literal">true</span>;
options = options || {};
<span class="hljs-keyword">this</span>.hostname = options.hostname || os.hostname();
<span class="hljs-keyword">this</span>.applacationName = options.applacationName || <span class="hljs-string">''</span>;
<span class="hljs-keyword">this</span>.applicationName = options.applicationName || <span class="hljs-string">''</span>;
<span class="hljs-keyword">this</span>.facility = options.facility || <span class="hljs-number">23</span>;
<span class="hljs-keyword">if</span> (options.color) {
<span class="hljs-comment">/** @type {boolean} */</span>
@ -1024,7 +1024,7 @@ uses BSD timeformat</p>
<div class="content"><div class='highlight'><pre> fmtMsg = <span class="hljs-string">'&lt;'</span> + pri + <span class="hljs-string">'&gt;'</span>;
fmtMsg += timestamp;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.hostname;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.applacationName;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.applicationName;
fmtMsg += <span class="hljs-string">' '</span> + msg;
fmtMsg += newLine;
resolve(fmtMsg);
@ -1266,7 +1266,7 @@ uses BSD timeformat</p>
* @public
* @this RFC5424
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {boolean} [options.timestamp=false] - Included a Timestamp
* @param {boolean} [options.timestampUTC=false] - RFC standard is for
@ -1316,7 +1316,7 @@ uses BSD timeformat</p>
<span class="hljs-keyword">this</span>.constructor__ = <span class="hljs-literal">true</span>;
options = options || {};
<span class="hljs-keyword">this</span>.hostname = options.hostname || os.hostname();
<span class="hljs-keyword">this</span>.applacationName = options.applacationName || <span class="hljs-string">''</span>;
<span class="hljs-keyword">this</span>.applicationName = options.applicationName || <span class="hljs-string">''</span>;
<span class="hljs-keyword">if</span> (<span class="hljs-keyword">typeof</span> options.timestamp === <span class="hljs-string">'undefined'</span> || options.timestamp) {
<span class="hljs-comment">/** @type {boolean} */</span>
<span class="hljs-keyword">this</span>.timestamp = <span class="hljs-literal">true</span>;
@ -1792,7 +1792,7 @@ uses BSD timeformat</p>
fmtMsg += <span class="hljs-string">'1'</span>; <span class="hljs-comment">// Version number</span>
fmtMsg += <span class="hljs-string">' '</span> + timestamp;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.hostname;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.applacationName;
fmtMsg += <span class="hljs-string">' '</span> + <span class="hljs-keyword">this</span>.applicationName;
fmtMsg += <span class="hljs-string">' '</span> + pid;
fmtMsg += <span class="hljs-string">' '</span> + id;
fmtMsg += <span class="hljs-string">' '</span> + structuredData;

View File

@ -85,7 +85,7 @@ and the <a href="https://nodejs.org/api/dns.html#dns_dns_promises_api">DNS Promi
create formatted messages or use directly</p>
<p><strong>RFC3164</strong></p>
<pre class="prettyprint source lang-js"><code> let rfc3164 = new SyslogPro.RFC3164({
applacationName: 'MyApp',
applicationName: 'MyApp',
color: true,
extendedColor: true,
server: {
@ -94,7 +94,7 @@ create formatted messages or use directly</p>
});
rfc3164.info('My Message');</code></pre><p><strong>RFC5424</strong></p>
<pre class="prettyprint source lang-js"><code> let rfc5424 = new SyslogPro.RFC5424({
applacationName: 'MyApp',
applicationName: 'MyApp',
timestamp: true,
encludeStructuredData: true
color: true,

View File

@ -518,7 +518,7 @@ class RFC3164 {
* @public
* @this RFC3164
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {number} [options.facility=23] - Facility code to use sending this
* message
@ -561,7 +561,7 @@ class RFC3164 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
this.applicationName = options.applicationName || '';
this.facility = options.facility || 23;
if (options.color) {
/** @type {boolean} */
@ -840,7 +840,7 @@ class RFC3164 {
fmtMsg = '&lt;' + pri + '>';
fmtMsg += timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + msg;
fmtMsg += newLine;
resolve(fmtMsg);
@ -1082,7 +1082,7 @@ class RFC5424 {
* @public
* @this RFC5424
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {boolean} [options.timestamp=false] - Included a Timestamp
* @param {boolean} [options.timestampUTC=false] - RFC standard is for
@ -1132,7 +1132,7 @@ class RFC5424 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
this.applicationName = options.applicationName || '';
if (typeof options.timestamp === 'undefined' || options.timestamp) {
/** @type {boolean} */
this.timestamp = true;
@ -1517,7 +1517,7 @@ class RFC5424 {
fmtMsg += '1'; // Version number
fmtMsg += ' ' + timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + pid;
fmtMsg += ' ' + id;
fmtMsg += ' ' + structuredData;

View File

@ -229,7 +229,7 @@ fashion where new messages are written to the class as needed.</div>
<tr>
<td class="name"><code>applacationName</code></td>
<td class="name"><code>applicationName</code></td>
<td class="type">

View File

@ -230,7 +230,7 @@ fashion where new messages are written to the class as needed.</div>
<tr>
<td class="name"><code>applacationName</code></td>
<td class="name"><code>applicationName</code></td>
<td class="type">

View File

@ -475,7 +475,7 @@ class RFC3164 {
* @public
* @this RFC3164
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {number} [options.facility=23] - Facility code to use sending this
* message
@ -518,7 +518,11 @@ class RFC3164 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
if (options.applicationName) {
this.applicationName = options.applicationName;
} else {
this.applicationName = options.applacationName || '';
}
this.facility = options.facility || 23;
if (options.color) {
/** @type {boolean} */
@ -797,7 +801,7 @@ class RFC3164 {
fmtMsg = '<' + pri + '>';
fmtMsg += timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + msg;
fmtMsg += newLine;
resolve(fmtMsg);
@ -1039,7 +1043,7 @@ class RFC5424 {
* @public
* @this RFC5424
* @param {object} [options] - Options object
* @param {string} [options.applacationName='NodeJSLogger'] - Application
* @param {string} [options.applicationName='NodeJSLogger'] - Application
* @param {string} [options.hostname=os.hostname] - The name of this server
* @param {boolean} [options.timestamp=false] - Included a Timestamp
* @param {boolean} [options.timestampUTC=false] - RFC standard is for
@ -1089,7 +1093,11 @@ class RFC5424 {
this.constructor__ = true;
options = options || {};
this.hostname = options.hostname || os.hostname();
this.applacationName = options.applacationName || '';
if (options.applicationName) {
this.applicationName = options.applicationName;
} else {
this.applicationName = options.applacationName || '';
}
if (typeof options.timestamp === 'undefined' || options.timestamp) {
/** @type {boolean} */
this.timestamp = true;
@ -1474,7 +1482,7 @@ class RFC5424 {
fmtMsg += '1'; // Version number
fmtMsg += ' ' + timestamp;
fmtMsg += ' ' + this.hostname;
fmtMsg += ' ' + this.applacationName;
fmtMsg += ' ' + this.applicationName;
fmtMsg += ' ' + pid;
fmtMsg += ' ' + id;
fmtMsg += ' ' + structuredData;
@ -3374,4 +3382,3 @@ module.exports = {
CEF: CEF,
Syslog: Syslog,
};