# Redirect application log to devel.log file

**URL:** https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335
**Category:** YANG
**Created:** [October 22, 2020, 8:05pm UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335 "2020-10-22T20:05:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Biswajit84](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@Biswajit84](https://dmap-community.ductus.global/u/Biswajit84)
#### Post date: [October 22, 2020, 8:05pm UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/1 "2020-10-22T20:05:16Z")

</div>

Hi,  
I would like to redirect my confd application logs to devel.log.So that based on confd debug level logs will get stored in devel.log.Also which macro I should use if CONFD\_DEBUG/CONFD\_TRACE is enabled.

Regards,  
Biswajit

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [October 23, 2020, 6:43am UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/2 "2020-10-23T06:43:57Z")

</div>

Two common Linux examples:  
`my_app_printing_logs_to_stderr 2> devel.log &`  
or (since we like tail -f)  
`tail -F my_app.log devel.log &`

See this post on the topic of printing the application log to a file: [Confd\_trace log file](http://dmap-community.ductus.global/t/confd-trace-log-file/3140/2)

I would prefer CONFD\_TRACE for debugging my application and CONFD\_DEBUG when deploying

---

<div class="post-metadata">

### Author: ![mnovak](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mnovak/32/183_2.png) [@mnovak](https://dmap-community.ductus.global/u/mnovak)
#### Post date: [October 23, 2020, 7:36am UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/3 "2020-10-23T07:36:12Z")

</div>

In case you need to use logging and do not require logs are in `devel.log`, for C applications you can also use logging framework that is part of examples. See `examples.confd/logging_framework`

---

<div class="post-metadata">

### Author: ![Biswajit84](https://avatars.discourse-cdn.com/v4/letter/b/13edae/32.png) [@Biswajit84](https://dmap-community.ductus.global/u/Biswajit84)
#### Post date: [October 23, 2020, 7:53am UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/4 "2020-10-23T07:53:53Z")

</div>

Hi,  
In the existing devel.log only, i would like to redirect my application log into that.  
So for that do I need to use any specific API instead of using of printf .

Regards,  
Biswajit

---

<div class="post-metadata">

### Author: ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)
#### Post date: [October 23, 2020, 3:11pm UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/5 "2020-10-23T15:11:04Z")

</div>

If you are using the Erlang ConfD API and your application is running _inside_ ConfD, you can use `econfd:log/2,3,4`; otherwise, there is no API that would allow you to send your logs into devel.log.

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [October 23, 2020, 4:10pm UTC](https://dmap-community.ductus.global/t/redirect-application-log-to-devel-log-file/3335/6 "2020-10-23T16:10:48Z")

</div>

Just fprintf() to a file that you open similar to the link I provided. Then use one of the two Linux examples I explained-
