# PetscEventRegLogRegister
Registers an event for logging operations in an application code. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscEventRegLogRegister(PetscEventRegLog eventLog, const char ename[], PetscClassId classid, PetscLogEvent *event)
```
Not Collective


## Input Parameters

- ***eventLog -*** The `PetscEventLog`
- ***ename    -*** The name associated with the event
- ***classid   -*** The classid associated to the class for this event



## Output Parameter

- ***event    -*** The event



## Example of Usage
```none
      int USER_EVENT;
      PetscLogDouble user_event_flops;
      PetscLogEventRegister("User event name",0,&USER_EVENT);
      PetscLogEventBegin(USER_EVENT,0,0,0,0);
         [code segment to monitor]
         PetscLogFlops(user_event_flops);
      PetscLogEventEnd(USER_EVENT,0,0,0,0);
```



## Notes
PETSc can gather data for use with the utilities Jumpshot
(part of the MPICH distribution).  If PETSc has been compiled
with flag -DPETSC_HAVE_MPE (MPE is an additional utility within
MPICH), the user can employ another command line option, -log_mpe,
to create a logfile, "mpe.log", which can be visualized
Jumpshot.

This is a low level routine used by the logging functions in PETSc




## See Also
 `PetscLogEventBegin()`, `PetscLogEventEnd()`, `PetscLogFlops()`,
`PetscEventLogActivate()`, `PetscEventLogDeactivate()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/logging/utils/eventlog.c.html#PetscEventRegLogRegister">src/sys/logging/utils/eventlog.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/logging/utils/eventlog.c)


[Index of all Profiling routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
