@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
42 lines (28 loc) • 1.1 kB
Markdown
lang: en
title: 'API docs: logging.loginvocation'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/logging
permalink: /doc/en/lb4/apidocs.logging.loginvocation.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/logging](./logging.md) > [logInvocation](./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/logging';
export class HelloController {
@logInvocation()
hello(name: string) {
return `Hello, ${name}`;
}
}
```