# PetscLogDefaultBegin
Turns on logging of objects and events using the default logging functions `PetscLogEventBeginDefault()` and `PetscLogEventEndDefault()`. This logs flop rates and object creation and should not slow programs down too much. This routine may be called more than once. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscLogDefaultBegin(void)
```
Logically Collective over `PETSC_COMM_WORLD`


## Options Database Key

- ***-log_view [viewertype:filename:viewerformat] -*** Prints summary of flop and timing information to the
screen (for code configured with --with-log=1 (which is the default))



## Usage
```none
      PetscInitialize(...);
      PetscLogDefaultBegin();
       ... code ...
      PetscLogView(viewer); or PetscLogDump();
      PetscFinalize();
```



## Note
`PetscLogView()` or `PetscLogDump()` actually cause the printing of
the logging information.




## See Also
 `PetscLogDump()`, `PetscLogAllBegin()`, `PetscLogView()`, `PetscLogTraceBegin()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/logging/plog.c.html#PetscLogDefaultBegin">src/sys/logging/plog.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex76.c.html">src/ksp/ksp/tutorials/ex76.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex79.c.html">src/ksp/ksp/tutorials/ex79.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/logging/plog.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)  
