Make sure the directory C:\tmp exists. If it does not, your third call will fail.
I normally use unicode and double slashes for my workspaces.
u"J:\\restored-20101025\\basemaps\\ALTA\\FileGeodatabase\\GEOBASE_GIS_DATA.gdb"
But the big problem is that your logfile.close() is inside your for loop.
That needs to be outside the for loop, or else you will close the logfile after the first featureclass name is written.
You also have a typo in your variable assignment for fcLst.
import arcpy, os
arcpy.env.workspace = u"J:\\restored-20101025\\basemaps\\ALTA\\FileGeodatabase\\GEOBASE_GIS_DATA.gdb"
if os.path.exists(arcpy.env.workspace):
if not os.path.isdir(r"C:\tmp"):
os.mkdir(r"C:\tmp")
logfile = open(r"C:\tmp\log.txt", "w")
fcList = arcpy.ListFeatureClasses()
dsList = arcpy.ListDatasets()
for fc in fcList:
logfile.write(fc+"\n")
for ds in dsList:
fcList = arcpy.ListFeatureClasses("","All",ds)
for fc in fcList:
logfile.write(fc+"\n")
logfile.close()
else:
print("Workspace does not exist.")