Abseil logging destination

50 views
Skip to first unread message

Jiawen Chen

unread,
Oct 5, 2023, 5:19:54 PM10/5/23
to Abseil.io
Hello all,

I'm investigating migrating my team's various projects from glog to Abseil logging. One thing that came up is the concept of "log destination". glog has the concept of initializing itself with the program name (e.g., google:InitializeGoogleLogging(argv[0])), and appears to place logs under /tmp/$PROGRAM_NAME.$hostname.$user.log.$severity.YYYYYMMDD-HHMMSS.UUUUUU.log.

What does Abseil logging do? The guide claims in the intro that it writes short text messages to stderr, disk files, or other sinks. But Googling around, there is no indication of what these disk files are by default.

Are users expected to create their own log sink from the getgo if we want to log to disk?

Some additional documentation and/or context would be helpful here.

Thanks!

Gennadiy Rozental

unread,
Oct 5, 2023, 5:39:39 PM10/5/23
to Jiawen Chen, Abseil.io
Hi Jiawen,

Abseil Logging library does not provide in the open source version any LogSink implementations dedicated to saving entries to files, but they are really easy to implement based on ofstrem interface. You can choose your own naming scheme as well.

Gene


--
You received this message because you are subscribed to the Google Groups "Abseil.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to abseil-io+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/abseil-io/db0bc320-61a0-4131-b21f-99c40c2ea044n%40googlegroups.com.

Jiawen Chen

unread,
Oct 5, 2023, 5:51:16 PM10/5/23
to Abseil.io
Thanks for the clarification!

+1 to removing them from the base - it's a bit opinionated and certainly helps keep the API surface small and better tested.

-Jiawen

city invoker

unread,
Oct 31, 2023, 8:30:56 AM10/31/23
to Abseil.io
i got the same problem in grpc server, found abseil got a log library, but really not do all the job a log library should do, like enable configuration a log format, log tracing requestid, config log file, and log file zip or remove etc. Another choise is glg, and turns out glog does not provide all thoes feature too, i have to implement those for my own. And comes a result, theres abseil log library and glog in my project, and that makes confuse!!!! and suck
Reply all
Reply to author
Forward
0 new messages