In this paper a temporal logic framework is introduced to the optimal control problems of discrete event systems. The temporal logic model is enhanced with the event cost function and a measurement space is also defined. The optimal controller synthesis procedure is guided by the heuristic search methods. For the heuristic search, the A* algorithm is used to solve the problems. An example is shown to illustrate our results.