@loopback/docs
Version:
Documentation for LoopBack 4
43 lines (28 loc) • 1.14 kB
Markdown
lang: en
title: 'API docs: extension-logging.loginvocation'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/extensions/logging
permalink: /doc/en/lb4/apidocs.extension-logging.loginvocation.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/extension-logging](./extension-logging.md) > [logInvocation](./extension-logging.loginvocation.md)
## logInvocation() function
`@logInvocation` decorator for method invocations.
<b>Signature:</b>
```typescript
export declare function logInvocation(): (target: any, method?: string | undefined, methodDescriptor?: TypedPropertyDescriptor<any> | undefined) => any;
```
<b>Returns:</b>
(target: any, method?: string \| undefined, methodDescriptor?: TypedPropertyDescriptor<any> \| undefined) => any
## Example
```ts
import {logInvocation} from '@loopback/extension-logging';
export class HelloController {
@logInvocation()
hello(name: string) {
return `Hello, ${name}`;
}
}
```