You can put pdffonts in a script so that after you compile the document it automatically generates the text file you want, texfonts.sh:
#!/bin/sh
set -e
INFILE="$1"
latexmk -pdf -lualatex "$INFILE"
pdffonts "${INFILE%.tex}.pdf" > "${INFILE%.tex}-fonts.txt"
Here's a sample file to demonstrate, test.tex:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}
\setsansfont{TeX Gyre Heros}
\setmonofont{TeX Gyre Cursor}
\newfontfamily{\chinesefont}{FandolFang}
\newfontfamily{\greekfont}{EB Garamond}
\usepackage{sectsty}
\allsectionsfont{\sffamily}
\usepackage{lipsum}
\begin{document}
\section{Hello}
\lipsum[1]
\subsection{Unicode}
\begin{tabular}{ll}
Greek & {\greekfont λόγος} \\
Mandarin & {\chinesefont 我们爱狗。} \\
\end{tabular}
\subsection{World}
\textbf{\lipsum[2]}
\section{Code}
\verb|\relax\bye|
\end{document}
Run sh texfonts.sh test, and there will be two outputs: the text file test-fonts.txt and the PDF.
test-fonts.txt:
name type encoding emb sub uni object ID
---------------------------------------- ----------------- ---------------- --- --- --- ---------
DETGWH+TeXGyreHeros-Bold-Identity-H CID Type 0C Identity-H yes yes yes 5 0
FHSMPY+TeXGyrePagella-Regular-Identity-H CID Type 0C Identity-H yes yes yes 7 0
NRRIPR+EBGaramond12-Regular-Identity-H CID Type 0C Identity-H yes yes yes 9 0
OAALEX+FandolFang-Regular-Identity-H CID Type 0C Identity-H yes yes no 11 0
JRCOOU+TeXGyrePagella-Bold-Identity-H CID Type 0C Identity-H yes yes yes 13 0
VTYOBX+TeXGyreCursor-Regular-Identity-H CID Type 0C Identity-H yes yes yes 15 0

.logalready. Do you mean you want this for diagnostic purposes or that you want to generate a colophon in the actual output? – jon May 23 '16 at 00:26pdffonts myfile.pdfto get a the font info. But the.logtells you about the substitutions that were made so you can fix the problems (if any). – jon May 23 '16 at 00:38