---
lang: en
title: 'API docs: logging.loginvocation'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/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) &gt; [@loopback/logging](./logging.md) &gt; [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&lt;any&gt; \| undefined) =&gt; any

## Example


```ts
import {logInvocation} from '@loopback/logging';

export class HelloController {
  @logInvocation()
  hello(name: string) {
    return `Hello, ${name}`;
  }
}

```


