Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- List: JavaScript global methods
- JavaScript global method: base64Decode
- JavaScript global method: base64Encode
- JavaScript global method: compile
- JavaScript global method: doHTTPRequest
- JavaScript global method: doSOAPRequest
- JavaScript global method: execute
- JavaScript global method: getLog
- JavaScript global method: help
- JavaScript global method: insertDatum
- JavaScript global method: makeSCWebURL
- JavaScript global method: print
- JavaScript global method: Quit
- JavaScript global method: RCtoString
- JavaScript global method: readFile
- JavaScript global method: setAppMessage
- JavaScript global method: stripHtml
- JavaScript global method: uncompressFile
- JavaScript global method: writeAttachmentToFile
- JavaScript global method: writeFile
- JavaScript global method: xmlstring
JavaScript global method: getLog
This method retrieves a logger named according to the value of the name parameter.
Syntax
getLog (name)
Arguments
The following argument is valid for this function.
Argument | Data type | Required | Description |
---|---|---|---|
name
|
String | Yes | The name of the logger to retrieve |
Return values
A logger named according to the value of the name parameter.
Description
This method retrieves a logger named according to the value of the name parameter. Loggers are normally named entities, using dot-separated names such as "lib.test01.func01." The logger object in JavaScript is an adapter of log4j in the Service Manager server. Logger names and levels follow the rules of log4j.
Example
This example does the following:
- Retrieve a logger with the given name.
- Set the logger level to trace.
- Print different level messages.
- Set the log levels by the code.
var log = getLog('lib.test01.func01');
log.setLevel('trace');
if (log.isTraceEnabled()){
log.trace('trace message');
}
if (log.isDebugEnabled()){
log.debug('debug message');
}
if (log.isInfoEnabled()){
log.info('informatin message');
}
if (log.isWarnEnabled()){
log.warn('warning message');
}
if (log.isErrorEnabled()){
log.error('error message');
}
if (log.isFatalEnabled()){
log.fatal('fatal message');
}
// Set level by code
log.setLevel("trace");
log.setLevel("debug");
log.setLevel("info");
log.setLevel("warn");
log.setLevel("error");
log.setLevel("fatal");
log.setLevel(0); //trace
log.setLevel(1); //debug
log.setLevel(2); // info
log.setLevel(3); // warn
log.setLevel(4); // error
log.setLevel(5); // fatal
To set a Javascript logger level, follow these steps:
- Go to Tailoring > Script Library.
- Click More > Javascript Logger.
- In the Name field, type the name of the logger.
- In the Level field, select a value from the following values: Trace, Debug, Info, Warn, Error, and Fatal.
- Click Save.
Note The logger level will be cleared after the HPE Service Manager server is restarted.
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-ITSM@hp.com.
Help Topic ID:
Product:
Topic Title:
Feedback: